I'm trying to run the autopep8 linter on a Python file in VSCode.
I've followed the instructions here: https://code.visualstudio.com/docs/python/environments and selected my interpreter (??P): /usr/local/bin/python
I then try to format my code, and VSCode says autopep8 isn't installed, and can be installed via Pip. However, when I try to install via Pip, it says There is no Pip installer available in the selected environment
.
I then tried launching a terminal in the current environment by selecting Python: Create Terminal from the Command Palette.
The terminal opens fine, pip
is present, and I'm even able to pip install autopep8
in the terminal that opened in VSCode, but when I try running the Format Document command I get the same errors that autopep8
and pip
aren't available in the environment.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…