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
2

There are 2 answers

0
Jill Cheng On

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

1
Vaibhav Gupta On

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.