15

I may have messed up some environmental path variables.

I was tinkering around VS Code while learning about Django and virtual environments, and changing the directory path of my Python install. While figuring out how to point VS Code's default Python path, I deleted some User path variables.

Then, isort began to refuse to run.

I've tried uninstalling the extension(s), deleting the ms-python.'s, and uninstalling VS Code itself, clearing the Python Workspace Interpreter Settings, and restarting my computer.

Even if it's not my path variables, anyone know the defaults that should be in the "user" paths variables?

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Nikola da Vinci
  • 145
  • 1
  • 1
  • 4

6 Answers6

14

Another reason maybe that you are using a python version older than 3.7, which isort is not supporting anymore. Here is a reference link.

Yixuan Wei
  • 165
  • 5
8

I also had this error on one of my windows machines. I don't know why the isort extension only chrashed on this machine and worked well on the other windows machines.

I fixed it by manually setting the path to python.exe in the settings of the isort extension:

In VSCode go to Settings > Extensions > isort > Interpreter and enter the path to python.exe for example:

C:\WinPython\WPy64-39100\python-3.9.10.amd64\python.exe

Franky1
  • 402
  • 6
  • 15
3

You need to find the location of the python.exe file.

Usually it is C:\Users\Admin\AppData\Local\Programs\Python\Python310\

You can also automatically add python to the system environment by deleting and reinstalling it. During installation, a small box is automatically checked to add environment variables.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13
  • Thanks, @MingJie-MSFT! I have hope for this solution, but I got an error when uninstalling Python. I used geek uninstaller to remove Python and as I go to reinstall, I still get an error log. Here are the two codes that appear repeatedly: Error 0x80072ee7: Failed to send request to URL: https://www.python.org/ftp/python/3.11.0/amd64/core_pdb.msi, trying to process HTTP status code anyway. Error 0x80072ee7: Unknown HTTP status code 0, returned from URL: https://www.python.org/ftp/python/3.11.0/amd64/core_pdb.msi Error 0x80070003: Failed to install MSI package. Ideas? Thanks! – Nikola da Vinci Nov 17 '22 at 13:22
  • I tried reinstalling .NET framework to fix the issues and am getting fatal error during installation: 0x80070643. I've also tried using Windows Troubleshooting tool for Windows Update. It says that it changed something, but I did not fix my fatal error. Forgive me for the terrible formatting, I'm trying to figure out how you did the multiple linebreaks in a row. – Nikola da Vinci Nov 17 '22 at 13:39
  • You can refer to [this issue](https://stackoverflow.com/questions/42324425/how-to-uninstall-python-and-all-packages) to learn about how to uninstall python. – MingJie-MSFT Nov 18 '22 at 01:20
0

only change your python interpreter on VScode

  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 30 '23 at 09:30
0

I tried updating the path of interpreter, but it didn't work.

The version of my system Python was 3.6.9, which didn't work.

I then used the version of 3.11.4 for the interpreter path, and it worked.

I believe old Pythons are deprecated.

WhaSukGO
  • 575
  • 7
  • 17
-3

I ended up refreshing my Windows install. Was for the best because I'm repurposing an older machine anyway.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Nikola da Vinci
  • 145
  • 1
  • 1
  • 4