How does setup tools determine version of installed packages
<p>I am trying to package my application for distribution on PyPi using setuptools. One of our dependencies is pysam and we require version >=8.3, so in our setup.py we have:</p>

<pre><code>install_requires = ['pysam&gt;=8.4']
setup(
   ###lots of stuff here
   install_requires=install_requires)
</code></pre>

<p>When every time setup.py is run, it downloads and installs pysam, and then tells me it failed to find it:</p>

<pre><code>Extracting pysam-0.2.3-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
pysam 0.2.3 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/pysam-0.2.3-py2.7-linux-x86_64.egg
error: The 'pysam&gt;=0.8.4' distribution was not found and is required by umi-tools
</code></pre>

<p>I was a bit worried by the fact it was talking about pysam 0.2.3, so I checked the version in python</p>

<pre><code>&gt;&gt;&gt; import pysam
&gt;&gt;&gt; pysam.__version__
'0.9.1.4'
</code></pre>

<p>So pysam 0.9.1.4 is being installed. My questions are:</p>

<ol>
<li>How does setup tools determine if a requirement has been met, and could it be thinking pysam 0.2.3 is installed even though 0.9 is.</li>
<li>What else could be going on such that setuptools thinks pysam isn't install when it is?</li>
</ol>