When using virtualenv I find that the command: virtualenv -p python2.6 --no-site-packages ~/env/NEW_PROJECT works without any problems, however if I try to do virtualenv -p python2.4 --no-site-packages ~/env/NEW_PROJECT I receive the error "The executable python2.4 (from --python=python2.4) does not exist. Is there a way to setup a virtualenv with python2.4?
Thanks
2 Answers 2
You may not have python2.4 installed or not in your $PATH.
virtualenv, different from rvm, does not install Python versions, it only uses what you have already installed. When you use -p option, that means --python, you are telling virtualenv to create a new isolated environment based on that Python installation.
So, if you have a Python 2.4 installation somewhere, just do:
$ virtualenv --python /path/to/python2.4/bin/python2.4 --no-site-packages ~/env/NEW_PROJECT
PS.: --no-site-packages is deprecated in new virtualenv versions. By default it does not use global site-packages.
Comments
The support for python2.4 was dropped in virtualenv 1.8 therefore make sure you use virtualenv<=1.7.2.
which python2.4yield some result?