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

前端 未结 9 1741
生来不讨喜
生来不讨喜 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:56

    did you move the whole project after you open it with pycharm? if so, just remove the .idea/* (run rm -r .idea under you project)

    This problem is caused by: pycharm will create a .idea file under the project after the first time you import the project. SO the path in there will remain the old one after you moved the project. Thus the pycharm will keep trying to import 'old_path/venv/bin/activate' which is kept in .idea/*

    0 讨论(0)
  • 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.
    0 讨论(0)
  • 2021-01-17 08:03

    I just ran into the same problem with Python 3.6 (which I wanted to use) and Python 3.7 also installed in my computer. My solution was just to remove reference to Python 3.7 from System PATH.

    So my PATH is currently set:

    C:\Program Files\Python36\Scripts\
    C:\Program Files\Python36\
    

    That's all, hope it helps.

    0 讨论(0)
  • 2021-01-17 08:05

    I got the same problem on windows 10, and got the solution.

    PyCharm_Python_error.png

    Root cause: - Python cannot be launched due to no python27.dll.

    Solution: - Install python or put python27.dll in PATH

    Thanks.

    0 讨论(0)
  • 2021-01-17 08:10

    A fix for this issue, is tell to the global var named-> LD_LIBRARY_PATH to include the new python libraries compiled. Let's assume that you have just download python, extracted it & installed; assume that you have downloaded the 3.6.4 version

    For include the library, you have to edit your .bashrc file. (This file is quite interesting, have a look ;) ). This file is an "hidden file" placed in your home: nano ~/.bashrc is a quite easy text editor. Go at the end of the file and append this command, replacing your path of new python export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/whoami/Downloads/Python-3.6.4

    CTRL+X for save file.

    For load the new file:

    source ~/.bashrc

    0 讨论(0)
  • 2021-01-17 08:10

    Operating system: Windows 10 / cygwin

    Desired Python: 2.7.14

    Error: "SDK seems invalid"

    My fix:

    1. Remove Python 64 bit version
      1. Install Python 32 bit version
      2. using the windows environment variable dialog set PY_HOME={somedrive}\{somepath}\Python27
        PYTHONPATH={somedrive}\{somepath}\Python27

    note: I guess it works since the errors I see are python generated eg "Traceback (most recent call last): File ..."

    0 讨论(0)
提交回复
热议问题