pip: How to deal with different python versions to install Flask?
<p>I have different versions of Python installed on my Ubuntu machine (2.7.11, 2.7.12, 3.5). I would like to install Flask on the 2.7.12 as it used by Apache. </p>

<p>I have three pip{version} in my PATH which are: pip, pip2, and pip2.7. How do I know which one is for which python version. </p>

<p>I have already read <a href="http://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions">Here</a> but it didn't help my case as I need to differentiate between minor version number 2.7.11 and 2.7.12.</p>

<p>One thing is that I tried pip{version} install Flask for all three pips but the 2.7.12 still can't import Flask.</p>

<p>Any help is much appreciate it.</p>

<p>Thanks</p>

<p><a href="http://flask.pocoo.org/docs/0.11/installation/#virtualenv" rel="nofollow">You should always create virtualenvs for your projects</a>. You can create one like</p>

<pre><code>virtualenv -p &lt;path/to/python2.7.12&gt; &lt;path/to/new/virtualenv/&gt;
</code></pre>

<p>inside that virtualenv <code>pip</code> and <code>python</code> will always select the right interpreter and path.</p>

python python-2.7 pip