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

asked Jul 16, 2012 at 17:14
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.

answered Dec 15, 2012 at 14:28
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.

answered Mar 13, 2014 at 16:16

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.