Python Version (sys.version) Meaning?
<p>I've hit what should be a basic question... but my googles are failing me and I need a sanity check.  </p>

<p>If I run the following in my Python shell:</p>

<pre><code>&gt;&gt;&gt; import sys
&gt;&gt;&gt; sys.version
</code></pre>

<p>from two different Python environments, I get:</p>

<pre><code>'2.7.8 (default, Nov 10 2014, 08:19:18) \n[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)]'
</code></pre>

<p>and...</p>

<pre><code>'2.7.8 (default, Apr 15 2015, 09:26:43) \n[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)]'
</code></pre>

<p>Does that mean the two environments are actually running slightly different Python guts or is it enough that the '2.7.8' bit in that version string is the same so I can be confident these are 1:1 identical Python interpreters?  </p>

<p>If I am guaranteed they are the same, then what's the significance of the date and other parts of that version output string?</p>

<p>All you need to compare is the first bit, the 2.7.8 string.</p>

<p>The differences you see are due to the <em>compiler</em> used to build the binary, and when the binary was built. That shouldn't really make a difference here.</p>

<p>The string is comprised of information you can find in machine-readable form elsewhere; specifically:</p>

<ul>
<li><p><a href="https://docs.python.org/2/library/platform.html#platform.python_version" rel="nofollow"><code>platform.python_version()</code></a></p>

<blockquote>
  <p>Returns the Python version as string 'major.minor.patchlevel'.</p>
</blockquote></li>
<li><p><a href="https://docs.python.org/2/library/platform.html#platform.python_build" rel="nofollow"><code>platform.python_build()</code></a></p>

<blockquote>
  <p>Returns a tuple <code>(buildno, builddate)</code> stating the Python build number and date as strings.</p>
</blockquote></li>
<li><p><a href="https://docs.python.org/2/library/platform.html#platform.python_compiler" rel="nofollow"><code>platform.python_compiler()</code></a></p>

<blockquote>
  <p>Returns a string identifying the compiler used for compiling Python.</p>
</blockquote></li>
</ul>

<p>For your sample strings, what differs is the date the binary was build (second value of the <code>platform.python_build()</code> tuple) and the exact revision of the GCC compiler used (from the <code>platform.python_compiler()</code> string). Only when there are specific problems with the compiler would this matter.</p>

<p>You should normally only care about the Python version information, which is more readily available as the <a href="https://docs.python.org/2/library/sys.html#sys.version_info" rel="nofollow"><code>sys.version_info</code> tuple</a>.</p>

python