سؤال

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

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

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.

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?

Any help would be greatly appreciated.

PyCharm's project interpreters

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

Try adding these commands before you run your UI

set PYTHONHOME=C:\Python33
set PYTHONPATH=C:\Python33\lib
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top