Multilpe python versions and interpreters(Multilpe python版本和解释器)
问题描述
我正在尝试在我的 Windows 7 机器上设置 python 2.7.6(首先安装了 python 3.3.3).在设置项目解释器中添加项目解释器后选择项目解释器时,出现此错误
I am trying to setup python 2.7.6 on my windows 7 machine (python 3.3.3 was installed first). When selecting the project interpreter after adding it in settings-project interpreter, I get this error
文件C:Python33Libsite.py",第 173 行文件=sys.stderr) ^ SyntaxError: invalid syntax
File "C:Python33Libsite.py", line 173 file=sys.stderr) ^ SyntaxError: invalid syntax
最初在设置页面中添加python 2.7解释器时(与上面添加虚拟环境相比),它给出了这个错误消息
When initially adding the python 2.7 interpreter in the settings page (as compared to adding the virtual environment above), it gives this error message
无法在 C: 设置 python SDK: .... .SDK 似乎无效.
Cannot setup python SDK at C: .... . The SDK seems invalid.
在添加基于该解释器的任何虚拟环境时,我也会遇到类似的错误.
I also get a similar error when adding any virtual env based on that interpreter.
我已经在路径框中添加了 python27 路径,如图所示,但它似乎正在查看 Windows 中设置的路径.如果我必须改变这一点,那是否会破坏能够选择多个口译员的意义?
I've added the python27 paths in the Paths box as in the picture, but it seems to be looking at the path set in windows. If I have to change that, doesnt that defeat the point of being able to select multiple interpreters?
任何帮助将不胜感激.
推荐答案
我犯了一个非常愚蠢的错误:我使用的是 PYTHONPATH
而不是 PATH
.我将 PYTHON33
和 PYTHON27
都添加到了我的 PATH
中,并且成功了.
I made a really silly mistake: I was messing with PYTHONPATH
instead of PATH
. I added both PYTHON33
and PYTHON27
to my PATH
and it worked.
这篇关于Multilpe python版本和解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Multilpe python版本和解释器


基础教程推荐
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 筛选NumPy数组 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01