windows 更改 python 解释器窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1053794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Changing python interpreter windows
提问by Diones
I have two python installations, 2.5 and 2.6 I want to change the default python interpreter from 2.5 to 2.6. Anyone know how?
我有两个 python 安装,2.5 和 2.6 我想将默认的 python 解释器从 2.5 更改为 2.6。有谁知道怎么做?
回答by John Machin
PYTHONPATH is NOTwhat you are looking for. That is for varying where Python's "import" looks for packages and modules.
PYTHONPATH不是您要找的。那是为了改变 Python 的“导入”查找包和模块的位置。
You need to change the PATHvariable in your environment so that it contains e.g. "....;c:\python26;...." instead of "....;c:\python25;....". Click on start > control panel > system > advanced > environment variables. Select "path". Edit it. Click on OK enough times to get out of there.
您需要更改环境中的PATH变量,使其包含例如“....;c:\python26;....”而不是“....;c:\python25;....”。单击开始 > 控制面板 > 系统 > 高级 > 环境变量。选择“路径”。编辑它。单击“确定”足够多的时间离开那里。
回答by sunqiang
just FYI, since both c:\python25 and c:\python26 are on PATH, I copy C:\Python25\python.exe to C:\Python25\py25.exe, and copy C:\Python26\python.exe to C:\Python26\py26.exe Then just type py25(or py26) get the specific version.
仅供参考,因为 c:\python25 和 c:\python26 都在 PATH 上,我将 C:\Python25\python.exe 复制到 C:\Python25\py25.exe,并将 C:\Python26\python.exe 复制到 C :\Python26\py26.exe 然后只需输入 py25(或 py26) 即可获得特定版本。