KidMcC
KidMcC

Reputation: 486

PyCharm Cannot Run Program C:\\Anaconda\\python.exe

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 path C:\\Anaconda\\python.exe is coming from in the error, as I have uninstalled Anaconda and reinstalled it to C:\\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.

Upvotes: 10

Views: 27632

Answers (4)

Cohensius
Cohensius

Reputation: 545

Deleting the .idea folder solved the problem for me. Pycharm will create a new .idea folder with the correct path.

Upvotes: 5

John Morrison
John Morrison

Reputation: 4048

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.

Upvotes: 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" />
(...)

Upvotes: 3

Fioletibiel
Fioletibiel

Reputation: 131

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 ;)

Upvotes: 11

Related Questions