python -m venv .venv
# 1. Create (most people name it .venv)
python -m venv .venv
# 2. Activate it
# macOS / Linux / git-bash / WSL
source .venv/bin/activate
# Windows (Command Prompt or PowerShell)
.venv\Scripts\activate
# You'll see (.venv) in your prompt
# 3. Always upgrade pip first
python -m pip install --upgrade pip
# 4. Install your project packages
pip install fastapi uvicorn python-dotenv pytest httpx
# When finished → just type:
deactivate
# or close the terminal
python -m venv .venv && source .venv/bin/activate && python -m pip install --upgrade pip
Use .venv — it's fast, built-in, and still the standard.