10

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

4
  • Probably copy-paste the error into text, instead of / along with the image. Commented Nov 10, 2020 at 17:14
  • 1
    error: no python at C:\Users\AccountName\AppData\Local\Programs\Python\Python38-32\python.exe Commented Nov 10, 2020 at 17:16
  • Is your problem solved? Commented Nov 10, 2020 at 23:09
  • 4
    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. Commented Nov 11, 2020 at 6:45

10 Answers 10

8

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.

Sign up to request clarification or add additional context in comments.

Comments

6

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

Comments

2

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

Comments

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.

Comments

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.

Comments

0

check wheather django is installed (if your are using django framework).

pip install django

Comments

0

If you move your project from one computer to another with different Python version or environment:

  1. python -m venv env => this creates new folder for virtual env
  2. cp -r venv/Lib/site-packages/* env/Lib/site-packages/ => copy the site-packages from the old virtual environment (venv, use your own) to the new virtual env
  3. env/Scripts/activate => activate the new env
  4. You may delete the old virtual environment

Comments

0

This can occur if you install node.js in your machine. Just uninstall the python installed by node restart your computer and reinstall python. No need to delete your environment or anything else. Worked for me severally

Comments

0

It is mostly due to having conflicting virtual environments so always check and delete them.

Comments

-1

make sure to install virtualenv befor install python

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.