Unable to add Python Interpreter in PyCharm

I've been trying to add a Python Interpreter to PyCharm, but there appears to be a bug - there is no option to add an Interpreter within the PyCharm settings (see below screenshot).

Some guides point to the bottom bar containing an option to switch Interpreter - but that is not an option for me (see below screenshot). What can I do to set the Python Interpreter?

1
24 comments

It could be a known issue https://youtrack.jetbrains.com/issue/PY-48492, please try the workaround from there. Let me know if it doesn't help.

1

Thanks Andrey, that was the issue.

Copying and pasting that workaround here:

  1. Close your project in PyCharm
  2. Create a backup of your .idea/ folder
  3. Remove .idea/ folder
  4. Re-open your project

Your project will be reinitialized. You could then copy some of the settings files from your backup to your new .idea/ folder.

Thanks again!

2

This is not working for me. Its a complete nightmare. I jsut want to set an interpreter. Any other things i can do ?

0

Hi ! 

Same issue and the workaround doesn't work for me neither

I even tried to delete and reclone my project. 

Impossible to set an interpreter

0
Please check if the issue still happens with default settings.

To restore default settings, you can use **File | Manage IDE settings | Restore Default Settings...**. Your current settings will be backed up, so you can revert to them later if needed (to do this, just import settings from the backed up folder).
3

Hello ! 

I just tried it and it worked for me.

Thanks a lot and have a nice day

 

2

A bug that forces you to abandon pycharm. Should use another IDE.

2

Hello aleks.farrier,

Could you please try workarounds from earlier posts? 

If they are not helpful, please create an issue on YouTrack and attach idea.log(Help | Show Logs in...) to the thread.

0
  • THis is also happening with the latest PyCharm. There are so many bugs with PyCharm now, and this is the `nail in the coffin` for me. 
  • Debugger using modules just will not work – No one cares to fix it properly 
  • Now the Python Interpreter cannot be loaded, I keep pointing it to a PATH where the venv exists locally ,and it will not pick it up, this is highly frustrating and absolutely a nightmare for productivity. We are a company and cannot deal with this above garbage of a IDE that you guys are shipping now . 

    I am moving to NeoVim permanently and will just set up stuff manually, because using recent Pycharm has been an absolute nightmare of installs, reinstalls, cleaning Python, deleting repositories, etc .. and the debug goes on and on …

 

1

Same issue here, even with the very latest PyCharm. Neither of the solutions suggested work, and I cannot add an interpreter. Switching to VSCode until this is fixed. 

1

I faced the same problem on MacOS and was able to fix it by removing all the dots from the project folder name.

0

I just encountered same issue, but after I rename my ./venv → ./venv311, then it works. I think pycharm kept the venv name in cache somewhere, so it thought the venv already invalid and it won't add it again.

Maybe we should name the venv with hash….

1

I  have paid $99 for pycharm pro, but the issue is still here, bad experience, switch to vscode. Fuck you pycharm 

1

OK, this worked. I was able to use a new Poetry interpreter. Before, I could select the new interpreter and pycharm just would not take it. Basically, the new selection was ignored.---------------

Please check if the issue still happens with default settings.

To restore default settings, you can use **File | Manage IDE settings | Restore Default Settings...**. Your current settings will be backed up, so you can revert to them later if needed (to do this, just import settings from the backed up folder).

0

I love PyCharm, but the frustration with trying to set a venv is very, very real.  For me, the Restore Default Settings worked (eg, after installing a new Python version).

I hope the PyCharm team takes this frustration to heart.  It consumes hours to days.

I'd suggest some way of detecting that the settings are broken (for me, a tip was SDK name is use, but heaven only knows where that was), and provide an “override - use this venv!", or a button/message about the Restore Default Settings.  My main point, I think it's urgent you do something.

0
Hello there, 
There might be several reasons for the inability to add Python interpreters in PyCharm. If you encounter this issue, please get in touch with support with Help | Contact Support or create an issue on YouTrack so we can investigate the problem and provide a solution.
0

It seems that after removing an interpreter from one PyCharm project, adding it back in another PyCharm project quietly fails. The add interpreter dialog just refuses to add it back. PyCharm 2024.1 and PyCharm 2024.1.1.

0

Check if the same interpreter exists in File | Settings For New Projects | New Project Setup | Python interpreter, click on the dropdown list of interpreters, scroll to the bottom, select "Show All" and make the required interpreter globally available by removing the project association, or if this doesn't help, close PyCharm, remove jdk.tables.xml from the options folder in the configuration directory and re-add the interpreter.

0

Not working for Pycharm 2023.3.5 and neither for 2024.1.1, literally a bug that forces you to quit using this awful IDE.

Moving to VSCode isn't more comfortable, but at least it works. Bad.

0

Two years later and the bug is still there. It is a pure nightmare, and I have spent hours trying to get a simple interpreter running. When I try to add an interpreter (whether a new one or an existing one) and click OK, PyCharm appears to be working on it, but in the end, the window is blank, and the interpreter is not added.

0

Hi Macel Michal ,

Could you please try workarounds from the above posts? 

If it doesn't help, please create an issue on YouTrack and attach idea.log (Help | Show Logs in...) to the thread.

0

Hi,

To add a new interpreter you need to remove the current one and apply changes.

Here are the steps that worked for me:

1) Go to File → Settings → Project: <your project name> → Python Interpreter.

2) In the Python interpreter selection option set it to <No interpreter>.

3) Apply Changes. This is the most important step.

4) Cancel or close the settings window. The IDE should prompt you to select a local interpreter in the working directory. Select it. Done.

5) If 4) doesn't prompt any message, repeat step 1) and click on Add interpreter → Add Local Interpreter.

6) Check that the “Virtualenv Environment” option is highlighted.

7) If you didn't create the .venv folder, then check the “new” option and create the folder. If it's already created in the working directory or in other place, enter its path in the option “existing”. The IDE might suggest to add the interpreter of your .venv of the working directory if already created. If not suggested or not working after adding, enter its path by yourself.

8) If you are using an special interpreter, like a Conda interpreter, select the one you need in the step 6) instead of “Virtualenv Environment”. Proceed as needed.

 

Hope that works for you guys. Cheers! 

1

Hi,

A possible workaround;

The problem: When I added a local interpreter, it is not listed in the Python Interpreters pop-up. This is probably what you experience as well. 

Workaround: 

  1. On the Project -> Python Interpreter settings page, choose Show All.. in bottom of the Python Interpreter dropdown. It should open a pop-up which has an already filtered list on the left. 
  2. Remove the filter, you see the other virtual env associated with other projects or invalid ones indicated as red. 
  3. Remove the red ones
  4. (Optional) Remove the ones with the same name with the current project.
  5. Apply
  6. Continue to regular Add Local Interpreter steps. 
1

The key was disabling the funnel icon, it is a filter that hides what you need to erase:

1: when you try to add a new venv but it exists (even broken), it won't add and also will not give any feedback. You still see it don't appear.
2: Showing all venvs and disabling filter will show any broken venv (sureley with same name than the project) you MUST DELETE before adding any new venv for your project.

What is worng here:
1: no feedback adding a venv over an existing one.
2: broken venvs are affecting adding new ones but they are hidden by default in the window.
3:venvs are associated with the project name, but they can be used in different projects, thats ambigous, I prefer using venvs as an independent entity.

Thats my feedback. Pycharm is amazing, but this silly thing should go.

0

Please sign in to leave a comment.