How to setup virtual environment for Python in VS Code?

后端 未结 12 1903
灰色年华
灰色年华 2020-11-29 16:29

In my project folder I created venv folder.

python -m venv venv

When I in VS Code run command select python interpreter my ven

12条回答
  •  遥遥无期
    2020-11-29 16:55

    Many have mentioned the python.pythonPath method.

    Another way is adding a envFile in the launch.json like this:

        {
            "name": "Run",
            "etc": "etc",
            "envFile": "${workspaceFolder}/venv"
        }
    

提交回复
热议问题