Python - Enable Virtual Environment

January 19, 2026

Open your repo in VS Code

cd your-new-repo
code .

Create a virtual environment

# MacOS / Linux
python3 -m venv .venv

# Windows
python-m venv .venv

Activate the virtual environment

# MacOS / Linux
source .venv/bin/activate

# Windows
.venv\Scripts\Activate.ps1

Install packages

pip install requests boto3

Freeze dependencies

pip freeze > requirements.txt

Later, anyone can recreate the env with:

pip install -r requirements.txt

See also:

Python - Check Version