Invalid Python SDK Error while using python 3.4 on PyCharm

后端 未结 4 718
别跟我提以往
别跟我提以往 2021-01-17 10:51

When I switch my PyCharm to use Python 3.4.3 I am getting the error:

Invalid Python SDK

Also PyCharm does not automatically find

相关标签:
4条回答
  • 2021-01-17 11:16

    I go the same error message in Windows version of PyCharm after I re-installed Python (3.5) on a different location. The problem was that most of my existing virtual environments registered in PyCharm were still referencing the old installation of Python.

    I resolved it by deleting these existing virtual environments and creating a new one. If deleting existing interpreters (in virtual environment) is not an option, you should be able to modify them instead in File | Settings | Project Interpreter

    0 讨论(0)
  • 2021-01-17 11:18

    This also happened to me. I renamed a repository and then my virtual environment got stuck in the old path.

    I grepped all configuration files and could not find any reference to the old one.

    What finally solved the problem was to clear caches with the option File > Invalidate Caches / Restart...:

    0 讨论(0)
  • 2021-01-17 11:20

    I got the same issue, when I updated Python (3.x) version via Home brew in MacOS. Above answers didn't work for me. But with those, I realize that, it's an issue with linking the directories. I deleted ~/.virtualenvs folder and recreated all virtual envs.

    $ ls -a ~/.virtualenvs
    local-dev wdias-dev
    $ rm -rf ~/.virtualenvs
    $ which python3
    /usr/local/bin/python3
    $ mkvirtualenv local-dev --python=/usr/local/bin/python3
    $ mkvirtualenv wdias-dev --python=/usr/local/bin/python3
    

    Open the PyCharm again, and it works fine.

    0 讨论(0)
  • 2021-01-17 11:26

    I had the same issue. Try to comment/remove the PYTHONPATH variable in your ~/.bash_profile

    #export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
    

    If it does not help it also may be useful to look in the idea.log for the errors:

    /Users/username/Library/Logs/PyCharm40/idea.log
    

    I had the following errors:

    Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
         PYTHONPATH is currently: "/usr/local/lib/python2.7/site-packages/"
         You should `unset PYTHONPATH` to fix this.
    
    0 讨论(0)
提交回复
热议问题