4

I was running the Django project without any problems. Until I reinstalled Windows and then reinstalled vscode! Now that I am running the Django project, vscode shows the following error:

Error: no python at C:\Users\AccountName\AppData\Local\Programs\Python\Python38-32\python.exe 

enter image description here

Ann Zen
  • 25,080
  • 7
  • 31
  • 51
Remo
  • 63
  • 1
  • 1
  • 5
  • Probably copy-paste the error into text, instead of / along with the image. – Ann Zen Nov 10 '20 at 17:14
  • error: no python at C:\Users\AccountName\AppData\Local\Programs\Python\Python38-32\python.exe – Remo Nov 10 '20 at 17:16
  • Is your problem solved? – Ann Zen Nov 10 '20 at 23:09
  • 1
    Please note that if you reinstalled Windows (and python), you will most probably have to remove your venv and create a new one. The venv is not a standalone python container, but depends on the python which was used to create it. – np8 Nov 11 '20 at 06:45

6 Answers6

3

This might be occurs if the python directory still in the environment variables path list.

  1. First remove python entry from the environment variables path if exists.
  2. Also there will be a chance for virtual environments in your project. If the virtual environment is setup in the uninstalled python version then you will get the same error message. So, remove the virtual environments which is created under the uninstalled python. It can be done by deleting the virtual environment folder from your system.

enter image description here

Codemaker
  • 7,952
  • 3
  • 61
  • 53
0

Based on the information you provided, it is recommended that you check the Python environment variables.

Since the Windows system is reinstalled, the environment variables are restored to the default settings. Therefore, please add Python environment variables:

enter image description here

Or you can reinstall Python and check the "Add Python 3.8 to PATH" option, which will automatically add Python environment variables.

You could also refer to : Python environment variables.

Jill Cheng
  • 7,195
  • 1
  • 13
  • 22
0

It's very simple

  1. Delete your dbsqite3 file from your project folder
  2. Open your project in CMD
  3. install virtual environment pip install virtaualenv
  4. virtualenv .
  5. \scripts\activate
  6. python manage.py runserver

and play with your code you shared.

mosc9575
  • 3,723
  • 2
  • 6
  • 25
0

This works for Pycharm, It did to me From your projects folder, delete the 3 folders i.e. .ide,venv, and the third folder i think.. do not touch the projects or scripts you created. After wards, go to Pycharm and configure python interpreter again. This will now enable you to run yo scripts now with no prob

0

Edit pyvenv.cfg

home = C:\Users\UserName\AppData\Local\Programs\Python\Python38-32
include-system-site-packages = false
version = 3.8.3

When I edited this file after checking the file path on my computer, it worked for me.

0

make sure to install virtualenv befor install python

Zain Alabdeen
  • 479
  • 1
  • 2