DEVELOPER TOOL

Python venv Command Builder

Generate the venv create/activate commands for your OS and shell.

About this tool

Generate the exact sequence of commands to create and activate a Python virtual environment for your OS and shell — the activation command in particular differs enough between bash/zsh, PowerShell, and cmd that it's easy to get wrong or forget.

Frequently asked questions

Why does the activation command differ by shell?
Each shell has its own script format: bash/zsh source a plain shell script (source .venv/bin/activate), PowerShell runs a .ps1 script, and cmd runs a .bat file — venv creates all three so the right one works regardless of which shell you use.
Do I need to reactivate the environment every time?
Yes — activation only applies to your current terminal session. Opening a new terminal window or tab requires running the activation command again (creation only needs to happen once).
What does "Upgrade pip after activating" do?
Runs pip install --upgrade pip right after activation — the pip version bundled with a freshly created venv is sometimes older than the latest release, and newer pip versions often resolve dependencies more reliably.