4

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

3
  • 4
    Do you have Python 2.4 installed? It looks like it's trying to find Python 2.4 but can't see where it is installed. Commented Jul 16, 2012 at 17:15
  • 1
    Have you tried to point a full python 2.4 path ? Commented Jul 16, 2012 at 17:17
  • Does which python2.4 yield some result? Commented Jul 16, 2012 at 20:54

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

The support for python2.4 was dropped in virtualenv 1.8 therefore make sure you use virtualenv<=1.7.2.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.