John Mike
John Mike

Reputation: 2095

How do I setup VS Code for multiple python projects

I would like to use VS code for multiple python projects. Each of which uses a different virtualenv and has different linting rules.

How can I setup vscode to support this?

Upvotes: 2

Views: 1103

Answers (1)

viraj_os
viraj_os

Reputation: 788

You can point vscode to different python executables based off the virtualenv in .vscode/settings.json:

{
    "python.pythonPath": "/Users/me/.virtualenvs/.../python"
}

and then in your .vscode/launch.json use the variable as pythonpath (inside one of the run configurations, which should be auto-generated)

"pythonPath": "${config:python.pythonPath}",

Upvotes: 1

Related Questions