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?
Please sign in to leave a comment.
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.
Thanks Andrey, that was the issue.
Copying and pasting that workaround here:
.idea/
folder.idea/
folderYour project will be reinitialized. You could then copy some of the settings files from your backup to your new
.idea/
folder.Thanks again!
This is not working for me. Its a complete nightmare. I jsut want to set an interpreter. Any other things i can do ?
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
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).
Hello !
I just tried it and it worked for me.
Thanks a lot and have a nice day
A bug that forces you to abandon pycharm. Should use another IDE.
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.
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 …
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.
I faced the same problem on MacOS and was able to fix it by removing all the dots from the project folder name.
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….
I have paid $99 for pycharm pro, but the issue is still here, bad experience, switch to vscode. Fuck you pycharm
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).
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.
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.
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.
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.
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.
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.
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.
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!
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:
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.