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.
In the Environment Variables screen, go to System variables and click on Path to select it. Then with the Path selected, click the Edit… button. In the Edit environment variable screen, click on New and add the path where the PiP installation is located.
Select the Run command: pip install matplotlib option. This option installs matplotlib , and any packages it depends on (in this case, that includes numpy ). Consent to elevation if prompted to do so. After the package installs, it appears in the Python Environments window.
On Ubuntu16.04, I worked with Python3 in vscode and
apt-get install python3-pip
solves my problem.
That's because I discover that: Under my terminal, I type the pip -V
. It displays it's for Python2, not for Python3.
Man you can only change the interpreter.
Go in (ctrl + shift + p), then type Python: Select Interpreter, this way you choose the version that your extension needs.
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With