How to Activate Venv in Python?

Create a virtual environment: `python -m venv venv`

Activate on Windows Command Prompt: `venvScriptsactivate`

Activate on Windows PowerShell: `venvScriptsActivate.ps1`

Activate on macOS/Linux: `source venv/bin/activate`

Verify activation: `which python` or `where python`

Deactivate the venv: `deactivate`

Suggested for You

Trending Today