-
Bug
-
Resolution: Fixed
-
Major
-
None
Python allows multiple versions of python installed to the same $PYTHON_HOME. The different installations use a different executable name to differentiate. For example, on my workstation, I have:
python2.5
python2.6
python2.7
python2
python3.2
python3
python
All of these have a PYTHON_HOME of /usr. python2 gives me the python2.7 installation. python3 and python both give me python 3.2.
When you create a virtualenv, you can specify which python executable you wish to use by passing the name of the executable with the -p option. Once you're in the activated virtualenv, then the 'python' command is whatever you specified with the -p at virtualenv creation time.
I'd expect this plugin to take the full path to the executable as an input instead of the PYTHON_HOME directory. the PYTHON_HOME can be determined programatically once you have the full path to the executable. For backwards compatibility, it would be fine to leave the PYTHON_HOME configuration and have an "advanced" section to specify the name and/or full path to the executable. That way, you can have several Python installations provided by your OS's package manager (ubuntu/debian fully support this in their repos) all with the same PYTHON_HOME, but different executable names for the different versions.
See also: make altinstall in the CPython sources.
I'm having the same trouble. I'm using Ubuntu 12.04 with Python 2.7 as the system Python, and I installed a PPA for Python 2.6.
When I use the virtualenv builder I will always get the system Python (2.7) because both versions run from /usr.
I can manually create virtualenvs on the command line that correctly pick up the right version by using:
virtualenv -p python2.6 <envname>
or
virtualenv -p python2.7 <envname>