首页 > 解决方案 > 如果我已经安装了 python 扩展,如何将 VS Code 中的路径更改为扩展以及 autopep8 的正确路径是什么?

问题描述

尝试autopep8为 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

标签: pythonvisual-studio-codeautopep8

解决方案


Python扩展支持我们在VSCode中使用Python,但是我们安装的模块不在python扩展的路径下。

autopep8我们在当前的VSCode 环境中使用模块“ ” 。用于pip在 VSCode 终端中安装它:

在此处输入图像描述

查看:

在此处输入图像描述


推荐阅读