在 Windows 上运行已安装的脚本时出现问题,如下所示
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>
我试图通过遵循如何运行已安装的 python 脚本中的建议来解决这个问题?问题但没有运气:
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?
我认为这种情况下的特别之处在于脚本通过 OS ( )ve
运行命令脚本 (ve-init
等)。ve-clone
os.execvp()