Reputation: 42425
There's a problem with running installed scripts on Windows which can be seen below
C:\Users\Piotr>where python
C:\program files\Python\2.7\python.exe
C:\Users\Piotr>python c:\program files\Python\2.7\scripts\ve init
[Errno 2] No such file or directory
Is "ve-init" executable in the current path?
C:\Users\Piotr>
I tried to resolve this by following advices in How to run installed python script? question but with no luck:
C:\Users\Piotr>assoc .py
.py=Python.File
C:\Users\Piotr>ftype Python.File
Python.File=c:\program files\Python\2.7\python.exe "%1" %*
C:\Users\Piotr>dir /b "c:\program files\python\2.7\scripts"
easy_install-2.7-script.py
easy_install-2.7.exe
easy_install-script.py
easy_install.exe
pip-2.7-script.py
pip-2.7.exe
pip-script.py
pip.exe
ve-clone
ve-extend
ve-init.py
ve.py
virtualenv-script.py
virtualenv.exe
C:\Users\Piotr>python c:\program files\Python\2.7\Scripts\ve.py init
[Errno 2] No such file or directory
Is "ve-init" executable in the current path?
I think what's special in this case is that ve
script runs command scripts (ve-init
, ve-clone
etc.) through OS (os.execvp()
).
Upvotes: 0
Views: 703
Reputation: 42425
The solution is to add .py
extension to PATHEXT
environment variable so that Python scripts could be run without specifying extension (as long as they are on the PATH
).
Nevertheless this is not enough to get virtualenv-commands working on Windows because this package uses Unix specific tools which are not available on Windows.
Funny, I guess the idea behind creating virtualenv-commands was to make it more portable than virtualenvwrapper by not using shell scripts but it seems current implementation supports only Unix.
Upvotes: 0