0

I receive this error when trying to install module "autopep8" for VS Code:

rrgut@DESKTOP-NQJ4S14 MINGW64 ~/Documents/Raymond/HelloWorld
$ C:/Users/rrgut/AppData/Local/Programs/Python/Python39/python.exe c:\Users\rrgut\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py pip install -U autopep8 --user
C:\Users\rrgut\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Users\rrgut\Documents\Raymond\HelloWorld\Usersrrgut.vscodeextensionsms-python.python-2020.9.114305pythonFilespyvsc-run-isolated.py': [Errno 2] No such file or directory
Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
Razor One
  • 1
  • 1

2 Answers2

3

Step1:- First of all, you need to make sure that autopep8 module is installed in your PC, You can check this by using python -m autopep8 --version . If you can see the version then you can go to Step 3.

Step2:- You need to install autopep8 using the command line
pip install --user autopep8

Step3:- In the command line type where.exe autopep8 and copy that path to the Python>Formatting:Autopep8 Path which is present in the setting of Autopep8 package.

Vaibhav Gupta
  • 71
  • 1
  • 4
  • 1
    Your answer works (on Windows), but you did not clarify **where exactly** you would paste the path. I suggest merging this answer with [@Chen Wang 's answer](https://stackoverflow.com/questions/61923188/how-to-stop-autopep8-not-installed-messages-in-code#answer-66219550) 1. Go to Python extension's extension setting. 2. Find Python>Formatting:Autopep8 Path term 3. Add the full path of the autopep8 that you have installed. – Leonardo Pinheiro Feb 12 '22 at 01:23
1

The Python extension supports us to use Python in VSCode, but we install the module not in the path of the python extension.

We use the module "autopep8" in the current VSCode environment. Use pip to install it in the VSCode terminal:

enter image description here

check:

enter image description here

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25