Multilpe python 版本和解释器 [英] Multilpe python versions and interpreters

查看:57
本文介绍了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

File "C:\Python33\Lib\site.py", line 173 file=sys.stderr) ^ SyntaxError: invalid syntax

File "C:\Python33\Lib\site.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.我将 PYTHON33PYTHON27 都添加到了我的 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 版本和解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆