PyCharm Cannot Run Program C:\\Anaconda\\python.exe
Solution 1
Most likely one of your installations was set for "All Users" and installed to the C:\ directory. The error is "The System cannot find the file specified." This is most likely because "C:\Anaconda\python.exe" does not exist and should be "C:\users\my_name\Anaconda2". Be sure you have set PyCharm to use the correct path "C:\users\my_name\Anaconda2". Here is a link on configuring this, https://docs.anaconda.com/anaconda/user-guide/tasks/pycharm/.
You may want to check your PATH and remove anything pointing to C:\Anaconda in Control Panel> System> Advanced Settings> Environment Variables.
Solution 2
The given link is outdated. However I solved my problem by clicking "Run" at the Pycharm's toolbar and then "Edit Configurations..." and I change my Interpreter to another actual one. Just changing it in the settings does not help, but this opperation already does ;)
Solution 3
Deleting the .idea folder solved the problem for me. Pycharm will create a new .idea folder with the correct path.
Solution 4
This happened to me when I installed Pycharm. What I did was go to the .idea\workspace file of the project and change the path. Search and change the wrong route for the good one.
(...)
<option name="SDK_HOME" value="C:\Users\...\python.exe" />
(...)
KidMcC
Updated on September 28, 2021Comments
-
KidMcC over 2 years
When I go to run scripts in the terminal, I get an error in a red box that says
Pycharm cannot run program C:\Anaconda\python.exe (in directory E:\etc... CreateProcessError=2 The System cannot find the file specified.
I have uninstalled Anaconda and reinstalled it. I have also reinstalled PyCharm. Thing is though, I am using Anaconda2 and have my interpreter as
C:\\Users\\my_name\\Anaconda2
and this works when I apply it in settings. I am not sure where this pathC:\\Anaconda\\python.exe
is coming from in the error, as I have uninstalled Anaconda and reinstalled it toC:\\users\\my_name\\Anaconda2
If it is worth noting, I did import a PyCharm settings jar file earlier today, but then decided not to use it and to go back to my original settings. This was before uninstalling PyCharm and Anaconda out of frustration, so any effects of that I think should be moot anyway.
Any help would be greatly appreciated as I am stuck using the console until I can figure this out.
Thanks.
-
KidMcC almost 8 yearsGot it. That was it. Thank you!
-
Eliezer Miron over 5 yearsThis is the only answer online that helped me, thanks!
-
Wilmer E. Henao almost 5 yearsMost likely you were working on the project from 2 different computers. This is what happened to me
-
Lukas about 4 yearsThis has helped, great! I had to change configured Interpreter to a different one, confirm and then set back to original. My problem was that the whole folder was copied from another computer and although the incorrect setting was not visible (configuration showed correct Interpreter and settings), there was something wrong in meta data.