16
VSCode, pipenv, python
I want the missing python library warnings to disappear so I can use the "Problems" pane to find...er...real problems with the code
It seems (and I vaguely remember doing this in the past) it used to be the case that setting the pythonpath in the settings would fix this issue to a great extent. But now this does not work and the setting is marked as "deprecated"
The official docs for "Using Python environments in VS Code" are pretty good but they don't give an exact method for using pipenv. There are some good clues however. It seems that the key is to make a venv in the file folder .venv in the Project.
This work around is good for Linux or a Mac.
deactivate
command can stop a virtual environmentPIPENV_VENV_IN_PROJECT=1 pipenv shell

pipenv update
For projects with lots of dependencies, this will take a whileI found that the project - as well as having a Pipfile - had a library in a "vendor" folder! To fix this make a file in the project directory called .env with the contents
PYTHONPATH=vendor
If the folder has a different name to "vendor" set that in pythonpath
16