I'm playing with Visual Studio Code on Ubuntu. One big problem is I can't figure out how to attach a virtualenv to a file. So, I open the file. On the lower left corner, I see the default path to the system python executable:
when I click on it, a list with two paths is shown on the top middle box (both are the default system python's).
I tried to set the python.venvPath
(in green in the right window).
but it does not work.
My question is: how to assign a virtualenv to a project, so that whenever I open that file, it uses that venv?
I simply set the pythonPath variable in the local
.vscode/settings.json
to the python that should be used, like so:Code then automatically sources the virtualenv activate script before running files (like debugging or "run python file in terminal").
I use Ubuntu 18.04, Code 1.33.0 and Python Plugin 2019.3 from Microsoft