First, find out where pipenv has created your virtualenv setup and stashed the python executable you are using. From the command line in your project folder (where your Pipfile is), execute the following:
pipenv --py
This will give you the full path to your virtualenv python install. For my sample project it was:
VIRTUALENV_PYTHON_PATH_HERE=C:\Users\UmarDx\.virtualenvs\api-9dSW7b5h\Scripts\python.exe
Now, create a local settings file that VS Code will use for your project
mkdir .vscode && touch .vscode/settings.json
Open the settings.json file and paste in the following:
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/*.pyc": true,
"**/__pycache__": true
},
"python.pythonPath": "C:\\Users\\UmarDx\\.virtualenvs\\flask-login-96KNOJMU\\Scripts\\python.exe",
"python.linting.pylintArgs": [
"--load-plugins",
"pylint_flask"
]
}
If you also have pylint installed in your virtualenv environment then it will use that version to display any linting problems. If not, you can do that with the following.
pipenv install --dev pylint