Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

pycharm

enter image description here

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

Any solution to fix it?

like image 832
NibiruSpetsnaz Avatar asked Jan 05 '16 18:01

NibiruSpetsnaz


People also ask

How do I install Python interpreter?

Select the Add Environment command in the Python Environments window or the Python toolbar, select the Python installation tab, indicate which interpreters to install, and select Install. You can also manually install any of the interpreters listed in the table below outside of the Visual Studio installer.

What version of Python do I have PyCharm?

It's in File->Settings->project interpreter in newer versions. And in even newer (eg. 4.5. 4 and up) it's in File -> Settings -> Project: {your_project_name} -> Project Interpreter .


5 Answers

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/*

like image 58
Yicheng Feng Avatar answered Oct 09 '22 14:10

Yicheng Feng


I had such problem. The solution was pretty easy. I created an account in russian in Windows, and you could emphasize that the error message (the big one) then contains the word about encoding is used. Therefore check your Windows account name - change it if it's not in english and contains spaces and other unwanted signs. Thanks.

like image 22
Sergei Shumilin Avatar answered Oct 09 '22 14:10

Sergei Shumilin


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.
like image 21
Nathan Wailes Avatar answered Oct 09 '22 13:10

Nathan Wailes


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.

like image 23
Lon Avatar answered Oct 09 '22 14:10

Lon


In my case, python.exe that I had in my venv was the problem.

Thus, I downloaded a specific version of Python and pasted contests of its Script folder to my \venv\Scripts folder.

like image 41
Başar Söker Avatar answered Oct 09 '22 14:10

Başar Söker