Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring interpreter in PyCharm: "please use a different SDK name"

I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.

Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new options.

In this window it allows you to configure a virtual environment, the conda environment, and the system interpreter. I am assuming that I should configure the system interpreter. From there I point PyCharm to the interpreter on my Mac at /usr/local/Cellar/python3/3.6.3/bin/python3 and hit OK.

It then takes me back to the main window where it shows the path in the project interpreter. At this point I hit apply and get a message:

Cannot Save Settings please use a different SDK name

It doesn't matter which interpreter I choose, I get the same message. Has anyone else come up with the same problem and how do I fix this?

Interestingly my old projects still work correctly.

like image 376
Jon Avatar asked Dec 21 '17 21:12

Jon


People also ask

How do I fix the interpreter problem in PyCharm?

Change the Python interpreter in the project settings Press Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link. Select the target interpreter.

How do I fix the configuration in PyCharm?

From the main menu, select File | Manage IDE Settings | Restore Default Settings. Alternatively, press Shift twice and type Restore default settings . Click Restore and Restart. The IDE will be restarted with the default configuration.

Where does PyCharm store interpreter settings?

IDE settings are stored in the dedicated directories under PyCharm home directory. The PyCharm directory name is composed of the product name and version.

How do I change the target interpreter in PyCharm?

Just click it and select the target interpreter: Open the Settings / Preferences dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or PyCharm | Preferences for macOS. Select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link.

Why is my Python interpreter marked as unsupported in PyCharm?

When PyCharm stops supporting any of the outdated Python versions, the corresponding Python interpreter is marked as unsupported. Press Ctrl+Alt+S to open IDE settings and select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link. Alternatively, click the icon and select Show All.

How to run Python code in PyCharm?

To work with your Python code in PyCharm, you need to configure at least one interpreter. A system interpreter is the one that comes with your Python installation. You can use it solely for all Python scripts or take it as a base interpreter for Python virtual environments.

How do I add a system interpreter to a Python project?

Click the Python Interpreter selector and choose Add Interpreter. Press Ctrl+Alt+S to open the project Settings/Preferences and go to Project <project name> | Python Interpreter. Then click the icon and select Add. In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter.


4 Answers

I had the same problem while setting up the virtual environment for my project and no matter if I create a new virtual environment or select an existing one, I get the warning:

"Cannot Save Settings please use a different SDK name"

Finally I found the solution:

Click on the project interpreter dropdown and select show all.... There you might be having multiple virtual environments with same name. Now here is the conflict you need to fix manually by renaming them so every item has the unique name.

like image 121
Vedprakash Upraity Avatar answered Oct 06 '22 11:10

Vedprakash Upraity


I ran into this issue when trying to get docker up and running with Pycharm 2018.1 and using the container's Interpreter. I would get the error below.

"Cannot Save Settings please use a different SDK name"

The issue I had was due to having multiple python interpreters of the same name.

Under Pycharm || Preferences || Project Interpreter

Click "show all" within the Project Interpreter dropdown and then delete any / all interpreters that you don't need.

like image 24
Cathal Cronin Avatar answered Oct 06 '22 11:10

Cathal Cronin


Jon; I too noticed the difference in the latest version of PyCharm. It seems that it now has an affinity for the latest tool 'venv'. When you create an interpreter - that is what you get.

You can still create a virtualenv manually and point it there instead. I haven't looked into pointing it to a base python-bin because (frankly) you shouldn't generally do it.

My advice (and my proposed answer) is to embrace the change and let it create a 'venv' for you. From there, do all of your installs by "alt-F12". That will open a console with your virtual environment activate -- so your PIP installs into the virtual environment.

Once I began using virtual environments, I never looked back. It has made life much easier in the python world. Pycharm seems to know this as well and is trying to really encourage you to do the right thing.

SteveJ

[Edit Alternate way to get to terminal]

enter image description here

like image 4
SteveJ Avatar answered Oct 06 '22 13:10

SteveJ


How fix this in Windows 10:

  1. close Pycharm .
  2. delete this file: C:\Users\<username>\.PyCharmCE2018.3\config\options\jdk.table.xml
  3. open Pycahrm again and load all python interceptors again.
like image 4
Daniel Mandelblat Avatar answered Oct 06 '22 12:10

Daniel Mandelblat