如何让windows使用特定的`python.exe`?

2024-04-23 10:29:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试了Control Panel\Programs\Default Programs\Set Associations,也尝试了assoc/ftype,但是windows一直使用错误的python.exeC:\Python27\),而不是我想要的(C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\

>where python
C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe
C:\Python27\python.exe
C:\Program Files (x86)\LilyPond\usr\bin\python.exe

>assoc .py
.py=Python.File.WinPython

>ftype Python.File.WinPython
Python.File.WinPython=C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7
.9.amd64\python.exe "%1" %*

>set PATH
Path=C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64;...C:\Python27;C:\Python27\Scripts;...C:\Program Files (x86)\LilyPond\usr\bin;...
PATHEXT=.PY;...

我刚编了Python.File.WinPython,可以吗?在


Tags: downloadsfilesprogramexeusersx86amd64file
1条回答
网友
1楼 · 发布于 2024-04-23 10:29:49

{a1}

(但如果这样做,您将丢失python2.7注册)

另一种解决方案是:

call C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\scripts\env.bat
python my_progam_.py

相关问题 更多 >