Why do I get an 'SDK seems invalid' error when setting up my Project Interpreter in PyCharm?

前端 未结 9 1830
生来不讨喜
生来不讨喜 2021-01-17 07:35

\"enter

I try to set up project interpteter Python 3.5 in Pycharm and get an SDK error

9条回答
  •  不要未来只要你来
    2021-01-17 07:57

    I just had this error and got around it, and long-story-short I think it may have had to do with my PATH / PY_HOME / PYTHONPATH environment variables pointing to a different version of Python. Here's what I did:

    Background:

    • In my case, I was trying to get a Python 2.7 venv running on a laptop where I'd previously been working with Python 3.
    • I'm using Windows 7.

    Solution:

    1. Hit the Windows key to pop up the Start menu.
    2. Type out 'path' and hit Enter.
    3. The 'Environment Variables' window should appear.
      • There should be two sections of the window:
        1. One should say, "User variables for your_user_name".
        2. The other should say "System variables".
    4. In both sections of the window, look for and edit (if they exist) the PATH, PYTHONPATH, and PY_HOME environment variables.
      1. I removed any references to Python 3.
      2. I set the PY_HOME variable to C:\Python27 (or whatever the path is to the Python installation you're trying to get working in PyCharm.)
    5. I also deleted my installation of Python27 and reinstalled it, but I'm not sure that that was necessary.
    6. Restart PyCharm.

提交回复
热议问题