I want to use a python environment with the following:
- A virtual environment.
PYTHONPATH
with local paths for development.- Globally installed, linter-related packages--I don't want or need these in my virtual environment.
(1) is simple enough thanks to the docs.
"python.pythonPath": "<venv path>/bin/python",
I've handled (2) via adding it to an env file and my config:
"python.envFile": "${workspaceRoot}/.env"
The big problem is getting (1) and (3) together. Once (1) is set up, VSC starts complaining that it can't find the linters. The easy solution is update the linter paths:
"python.linting.pylintPath": "/usr/local/bin/pylint",
Unfortunately, that means the linters cannot find the modules installed in the virtual environment.
The closest answer I've been able to find is this: Visual Studio Code - How to add multiple paths to python path?, but it still doesn't get to the root of the problem.
I'm coming from Atom, where this sort of thing just worked...ironic. I'm trying out VS Code 'cuz so many parts of Atom don't work smoothly.