How can I set up a virtual environment for Python in Visual Studio Code?


Sun Aug 08 2021 00:11:24 GMT+0000 (Coordinated Universal Time)

Saved by @RyanJ

# Then open Python Terminal (Ctrl + Shift + P: Python: Create Terminal)

# cd to the workspace

# In the terminal:

py -m venv venv

# Then ctrl + shift + P: Python: Select Interpreter

# Then select entire workspace

# Then select C:\Code\venv\Scripts\python.exe, where 'Code' is the workspace

# Then create new Python terminal