My VSCode is using a locally installed anaconda environment, at the default directory, which places it in Program Files. Because of this I'm unable to install flake8 through VSCode, I get a permission error. If I update my conda environment at the local level to install flake8, does anyone know if VSCode recognize and be able to use the package then?
Usually yeah it will. But if it doesn't work for you, then you can try specifying absolute path to flake8 and enable it explicitly like so :
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "path/to/flake8",
you can even specify path to your conda environment :
"python.condaPath": "path/to/condaenv/",
Have you tried to:
- ctrl + shift + p
- write "select linter" then click on it
- click on flake8
Maybe that helps.
Yes, it will. You'll have to install flake8
into each environment that you specify as an interpreter for a project in VSCode.
I just installed Flake8 extension to VSCode as shown below. *I use Anaconda on Windows 11:
Then, it works properly as shown below:
VSCode changed the linting settings. The recommended way to do it now is using an extension. So install Flake8 extension.
Newer versions of the extension has an Flake8 linter embedded. So you don't need to install it in your machine.
VSCode documentation about linting improved a lot. Take a look, but is a summary:
- Install Flake8 extension
- It just works.
BTW: you should create a separated virtual environment for each of your projects. Doing this you'll be able to locally install packages.
© 2022 - 2024 — McMap. All rights reserved.
flak8
, find needed path, and insert in corresponding JSON file for flake8 configuration. – Unimposing