Question

I just installed Python 2.7.6.

$ python -V
Python 2.7.6

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

When I try to specify the Python version while creating a new virtualenv with

virtualenv -p /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7.6 test

I get:

The executable /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7.6 (from --python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7.6) does not exist

If I simply use virtualenv test to create a new virtualenv I still get Python 2.7.5. What am I doing wrong?

Était-ce utile?

La solution

Use the value returned by which:

virtualenv -p /Library/Frameworks/Python.framework/Versions/2.7/bin/python test

Python installations generally create executables and/or links to them with names like:

python
python2
python2.7

but not

python2.7.6

If you are concerned about confusion with the Apple-supplied system Python 2.7, don't be. Its path is at /usr/bin/python or /usr/bin/python2.7.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top