Specify 'pip' version in requirements.txt
<p>I develop a Python/Django application, which runs from a virtual environment (created by <code>virtualenv</code>). </p>

<p>When the virtual environment is created, the global version of <code>pip</code> is copied to the newly created environment by default, which might be quite outdated (for example, version <code>1.5.4</code> from <code>python-pip</code> package on Ubuntu 14.04).</p>

<p>To avoid manual <code>pip</code> upgrades, it sounds like a good idea to pin the <code>pip</code> version in <code>requirements.txt</code> file, for instance by adding the following line:</p>

<p><code>pip==8.1.2</code></p>

<p>Specifying the <code>pip</code> version there will also allow to upgrade <code>pip</code> in all the managed application environments (local, dev, production) by changing the line in the requirements file. </p>

<p>Does this sound like a good practice? Is there anything that can go wrong with this approach?</p>

<p>Please note that <code>pip</code> version listed in <code>requirements.txt</code> is going to be installed along with other requirements. So all requirements are going to be installed by old version of <code>pip</code> and the version specified in <code>requirements.txt</code> will be available afterwards.  </p>

<p>I always do:</p>

<pre><code>virtualenv /path/to/my/desired/venv/
source /path/to/my/desired/venv/bin/activate
pip install -U pip
pip install -r requirements.txt
</code></pre>

python pip virtualenv requirements.txt