10

No Python at 'C:\Users\~~~~\python.exe' error keeps coming out.. Even if I deleted my previous python and path, the file location is where I installed my previous python...

I want to use python in VS code and cmd on windows 10.

What I tried to fix it

  1. deleted python 3.7 version and reinstalled python 3.6 version.

  2. removed previous python 3.7 path and added python 3.6 version reinstalled to the Windows Path variable.

  3. remove ';' on windows path variable.
  4. put ';' on windows path variable.
  5. delete and reinstall python on vscode Extensions
soyeon Kim
  • 101
  • 1
  • 1
  • 4
  • Did you reopen VS Code after changing your path? – diaa Jun 24 '19 at 07:32
  • Did you change your `python.pythonPath` setting in VS Code to either point to where you have installed Python or deleted the setting to start from scratch? – Brett Cannon Jun 24 '19 at 23:41

5 Answers5

27

If you use venv, then look in that file: pyvenv.cfg

Altay Hunoğlu
  • 521
  • 1
  • 5
  • 10
3

The reason this happened to me was because I updated my python version. Therefore, the existing venv config was looking for an older python version. What I did was simply delete the existing virtual environment folder and created a new one.

To save all dependencies installed and transfer it into the new virtual environment, you can do the following:

  1. pip freeze > requirements.txt to save dependencies into a text file
  2. delete old venv folder
  3. create new venv folder
  4. pip install -r requirements.txt
DeeMeow
  • 701
  • 5
  • 7
  • 1
    This actually works for me and is my go to approach. Just remember to do `pip install -r requirements.txt` – amew646 Mar 25 '23 at 11:17
1

I ran into this issue when having done the following:

  1. I had Python 3.8 and 3.9 installed.
  2. Installed Python 3.10.
  3. Removed Python 3.8 and 3.9.
  4. Set PATH property to contain the paths to Python 10 installation folder and its Scripts folder.

After this, Python stopped working from console and in IDE. When trying to add the Python interpreter to the IDE (Intellij IDEA) I realised there was no python.exe in Python 10 folder.

To fix this, I uninstalled Python 10 altogether and installed it again. It started to work.

havryliuk
  • 136
  • 1
  • 11
0

First of all, make sure you have installed correct bit version for your version 32/64 bit...I would prefer to install python from Microsoft store...And restart VS Code...

If the error still exists try uninstalling and again installing Python extension for VS Code and restart VS Code...

And you can even try to install python in the path it is searching for... And also add the path to the environmental variable...

Hope this might solve your problem...as it has done mine.

-2

Okay this should cover your issue. Firstly check whether it is installed

 $ $(npm config get python)

or

 npm --add-python-to-path='true' --debug install --global windows-build-tool

Moreover, do not forget to run your client interface as administrator.

More on this topic https://github.com/felixrieseberg/windows-build-tools/issues/56

user9799161
  • 123
  • 2
  • 14