Python should already be installed. Here we are using Python3. In VS Code, open the terminal, and run the script to create a folder for the Virtual Environment setup.
Script Explanation | Script |
name of a virtual environment | Python |
makes virtual environment | -m |
execute building virtual environment | venv |
name of virtual environment | .venv |
python -m venv .venv
Once the folder has been created, then "Activate" the Virtual Environment.
.venv/Scripts/activate
.venv/bin/activate
If started properly, the following notation should appear (.venv)
If you need to deactivate VE, type the following code.
deactivate
Just from my experience, the virtual environment is very useful, but it also presents some unique challenges as well. But it's normally insignificant. Note: To call python, you can use python
or py
.
py -m pip install --upgrade pip