Bozho
Bozho

Reputation: 71

PyCharm Python interpreter error "No python at 'C:\Program Files\Python38\python.exe'

I'm using python 3.8.2. In pycharm i setup my python interpreter for my project to virtual environment and system interpreter set to C:/Python38/python.exe (where's actually my python and not C:\Program Files\Python38\python.exe)

I get error when running my file "No Python at 'C:\Program Files\Python38\python.exe'"

Project Interpreter settings screenshot

Upvotes: 6

Views: 39234

Answers (6)

Kai Ye
Kai Ye

Reputation: 1

if you get this error while running a batch script, delete the "venv" folder in the same directory as the script,and then run again.

Upvotes: 0

Hashitha Mihiran
Hashitha Mihiran

Reputation: 11

  1. In windows search for your python in your start menu.
  2. Then open that file location (If it is a shortcut then again right click and go to the file location).This is the path we need.
  3. Then in pycharm goto settings > project: main.py > python interpreter > add interpreter > add local interpreter.
  4. In there for virtual environment give that path we got in step 2.
  5. If you are opening a old file you have to add this path to the existing environment.
  6. If you are opening a new project you have to give it to the new environment(But for new projects pycharm automatically find the python path in the computer)

Upvotes: 1

JAbr
JAbr

Reputation: 332

Please try to update the python path in windows environment variables, check on the bottom left corner of Pycharm for the selected python interpreter which is being used while running the code, also check top right corner run main (edit configurations) in Pycharm.

Upvotes: 0

Susan
Susan

Reputation: 71

Even if it's a little bit late, I hope this solution helps someone struggling with the same problem : I had this issue while working with vscode and python venv : After changing the path of python on my pc, I got an error "No Python at 'Old/Path'.." I fixed it by changing the path of python in 'pyvenv.cfg' in the virtual environment folder. This is the content of the file :

home = C:\Program Files\Python    #the new path of python
include-system-site-packages = false
version = 3.10.4

Upvotes: 4

Anish
Anish

Reputation: 9

It occurs when your python files are missing or uninstalled. Try installing python again, and then reinstall PyCharm.

Upvotes: 0

pms
pms

Reputation: 944

In the File -> Settings of the pycharm check if the python interpreter is setup correctly:

enter image description here

Upvotes: 0

Related Questions