Running virtualenv myvenv --python=python
fails with "The executable python (from --python=python) does not exist" even if python is on the PATH:
$ which python
/c/Python27/python
The issue is wrong executable detection on Windows. python
is equivalent to python.exe
on Windows but this is not recognized by virtualenv. It works only if you use virtualenv myvenv --python=python.exe
.
FYI, it works if you do virtualenv --python=3.4 myenv
or virtualenv --python=2.7 myenv
.
Also works with --python=2
or --python=3
I see little point in the user supplying --python=python
as that's (in effect) the default. And --python-C:\Python34\python
seems odd - why not just add the .exe
? That's not to say this isn't somewhat odd behaviour, I'm just not sure it's a major issue in practice.
Looking at sashahart/vex#11 I'm not clear if you are saying there that vex passes --python=python
or you did so. If the former, it probably shouldn't, and I'd say that's a bug in vex. If the latter then I'd class this as user error (you should have omitted the --python
argument).
i had tried your both codes @ionelmc but still its not working
horler@horler-HP-245-G5-Notebook-PC:~/python_udemy/PyPI$ virtualenv testnv
The path python2 (from --python=python2) does not exist
horler@horler-HP-245-G5-Notebook-PC:~/python_udemy/PyPI$ virtualenv --python=3.4 myenv
The path 3.4 (from --python=3.4) does not exist
horler@horler-HP-245-G5-Notebook-PC:~/python_udemy/PyPI$ virtualenv --python=3 myenv
The path 3 (from --python=3) does not exist
horler@horler-HP-245-G5-Notebook-PC:~/python_udemy/PyPI$ virtualenv --python=2 myenv
The path 2 (from --python=2) does not exist
horler@horler-HP-245-G5-Notebook-PC:~/python_udemy/PyPI$
Most helpful comment
FYI, it works if you do
virtualenv --python=3.4 myenv
orvirtualenv --python=2.7 myenv
.