In Visual Studio Code Python project, you can create a Python virtual environment for your project. Open Command Palette (Ctrl+Shift+P), search for Pyton: Create Environment command.
This will auto set the workspace environment to the newly created virtual environment. Now in the terminal, run the pip install for the library needed.
pip install <library>
Alternativly, you can run following script to create the virtual environment (named venv or whatelse you prefer):
python -m venv <your project folder>\venv
This will create a venv folder under your project folder. Then run following script to activate your virtual environment:
& <your project folder>\venv\Scripts\Activate.ps1
References:
Python environments in VS Code
How to install Python Libraries in Visual Studio Code
FEATURED TAGS
ai
api
automation
azure
azure cosmos db
azure openai
azure vm
base64
dax
docker
excel
execution plan
hyper-v
infrastructure
m
machine learning
machine learning services
network
network card
performance
power automate
power bi
power bi report tricks
power query
powershell
python
qgis
query performance
regex
replication
snowflake
sql
sql script
sql server
sql server admin
sql server config
ssl
ssms
troubleshooting
unicode
vmware