how to setup multiple python version on debian (pip, virtualenvwrapper etc)
<p>I'm starting to use python and would like to setup my workstation which is running on linux (debian). Multiple version of python are installed:</p>

<pre><code>ot@station:/home/ot# ls -l /usr/bin/py
py3clean           pydoc3.4           python2            python3.4m-config
py3compile         pygettext          python2.6          python3-config
py3versions        pygettext2.7       python2.7          python3m
pybuild            pygettext3         python2.7-config   python3m-config
pyclean            pygettext3.4       python2-config     python-config
pycompile          pygmentex          python3            pythontex
pydoc              pygmentize         python3.4          pythontex3
pydoc2.7           pyste              python3.4-config   pyversions
pydoc3             python             python3.4m         
root@thinkstation:/home/nicolas# ls -l /usr/bin/py
</code></pre>

<p>My first question is regarding the package management system pip. I see the following output:</p>

<pre><code>ot@station:/home/ot# pip
pip     pip2    pip2.7  
</code></pre>

<p>How can I check which pip is used for which python version? They must be linked somehow. From the output above I guess pip2.7 is used for the installed version of python2.7. But what about the others? Why isnt there a pip2.6 and how can I use pip to install packages for the newest version (python 3.4?).</p>

<p>Once this is sorted out I would like to start some coding projects for which virtualenv seems extremely helpful. At this point I know which pip links to which python version. If my project should run under python3 I use the corresponding pip to install virtualenv and virtualenvwrapper. This implies there are different version of virtualenv and virtualenvwrapper on my local machine. How can I then use the right one for creating local environment?</p>

<pre><code>sudo apt-get install python3-pip  # install pip3
pip3 install virtualenv  

virtualenv venv  # create virtualenv called venv
source /venv/bin/activate  # activate the virtualenv
pip install xyz
[...]
deactivate
</code></pre>

<p>Note: to install packages <strong>within</strong> the virtual environment you simply use <code>pip</code>, even if its an python3 environment.</p>

<p>For further info on pip versions check out <a href="http://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions">this</a> post.</p>

python virtualenv virtualenvwrapper