PyCharm not finding Anaconda Python, giving "can't open file 'python': [Errno 2] No such file or directory?"

23,936

Solution 1

You have mentioned that you have already installed the Anaconda in your system. You can try the following,

  1. Go to Project Interpreter in Pycharm
  2. Under Conda Environment, choose the Existing Environment and select the python.exe from the Anaconda Installation folder in the Interpreter field.
  3. Enable the option, Make available to all projects and click ok.

You should now be able to see the libraries in the Project Interpreter.

Solution 2

Under Conda Environment, you can try to choose X:\Anaconda3\Scripts\conda.exe.

Solution 3

It seems that you have virtual environment installed without python version. If you are new to Python, it may be better if you follow the easiest path: download python 2.7 or 3.6 from Python website.

If you run the installer, you should find the python folder in C:\Python27 or C:\Python36.

Then you should assert that this folder is in windows paths, set them in Enviromental variables in System property.

For the last step you need to set Python interpreter in PyCharm:

File -> Settings -> Build, Execution, Deployment -> Console -> Python Console -> Python interpreter

and set as interpreter the python.exe file in your X:/PythonNN folder

Solution 4

I had the same issue and then solved it by running PyCharm as administrator.

Share:
23,936
Pavan Kumar
Author by

Pavan Kumar

Updated on June 16, 2020

Comments

  • Pavan Kumar
    Pavan Kumar almost 4 years

    I am new to Python. Installed Anaconda on my system. I installed PyCharm too. When I try to run a file from PyCharm I get this error message:

    C:\Python\Test\venv\Scripts\python.exe python 3.6 C:/Python/Test/while.py C:\Python\Test\venv\Scripts\python.exe: can't open file 'python': [Errno 2] No such file or directory

  • Denis Vitez
    Denis Vitez almost 5 years
    I was missing the "Make available to all projects" checkbox. After checking it, it stopped showing the said error. Thank you.