Cannot add conda environment to Pycharm – Conda executable path is empty even when it's not
Question:
I am pretty proficient in pycharm but it is the first time I stumble into this problem.
- I created a conda environment
- Finding the conda executable which for me is in
/home/my_username/.miniconda3/envs/py39/bin/python
- Adding it to pycharm results in:
I tried to search for this issue and error but the results didnt help.
I am using fedora 36 if it is relevant.
Edit: The output of which conda
is:
/home/my_username/.miniconda3/condabin/conda
Then trying to add it as the interpreter as suggested in Pycharm: Conda executable path is empty:
Answers:
I ended up re-installing the OS and now it works, I would not call it a solution but it is what it is – I couldnt waste more time on this as I have work to do.
You need to first tell PyCharm where conda executable is. This is not so obvious how, as there is no input field for that when adding existing conda environments. IMO it’s a UX flaw in PyCharm.
I found this input field only available when creating a NEW conda environment from within a PyCharm. Enter a ‘Conda executable’ there. In your case: /home/????/.miniconda3/bin/conda
Then I also created a new dummy conda environment so the path is stored and PyCharm is happy. Afterwards, you shouldn’t get that "Conda executable path is empty" anymore when adding new conda interpreter.
As the error mentions either you do not have a Conda installed on your system or the path is not recognized by the IDE. Creating a new project, double check if the bar conda executable: is correctly filled by the directory to the folder Conda is installed on your system.
Normally your IDE fill the conda executable automatically, if this is not the case and manually filling the empty bar did not help, I would recommend to delete and reinstall your conda.
Good Luck
I am pretty proficient in pycharm but it is the first time I stumble into this problem.
- I created a conda environment
- Finding the conda executable which for me is in
/home/my_username/.miniconda3/envs/py39/bin/python
- Adding it to pycharm results in:
I tried to search for this issue and error but the results didnt help.
I am using fedora 36 if it is relevant.
Edit: The output of which conda
is:
/home/my_username/.miniconda3/condabin/conda
Then trying to add it as the interpreter as suggested in Pycharm: Conda executable path is empty:
I ended up re-installing the OS and now it works, I would not call it a solution but it is what it is – I couldnt waste more time on this as I have work to do.
You need to first tell PyCharm where conda executable is. This is not so obvious how, as there is no input field for that when adding existing conda environments. IMO it’s a UX flaw in PyCharm.
I found this input field only available when creating a NEW conda environment from within a PyCharm. Enter a ‘Conda executable’ there. In your case: /home/????/.miniconda3/bin/conda
Then I also created a new dummy conda environment so the path is stored and PyCharm is happy. Afterwards, you shouldn’t get that "Conda executable path is empty" anymore when adding new conda interpreter.
As the error mentions either you do not have a Conda installed on your system or the path is not recognized by the IDE. Creating a new project, double check if the bar conda executable: is correctly filled by the directory to the folder Conda is installed on your system.
Normally your IDE fill the conda executable automatically, if this is not the case and manually filling the empty bar did not help, I would recommend to delete and reinstall your conda.
Good Luck