⚡
usefultools.dev
venv

Python venv Command Builder – Create & Activate

NOUVEAU

Python venv command builder: get the exact commands to create, activate, deactivate and delete a virtual environment on Windows, macOS and Linux, plus uv and conda.

Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.

Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.

Tool

Shell

  1. 1. Create
    py -m venv .venv
  2. 2. Activate
    .\.venv\Scripts\Activate.ps1
  3. 3. Upgrade pip
    python -m pip install --upgrade pip
  4. 4. Install requirements
    python -m pip install -r requirements.txt
  5. 5. Check
    python -c "import sys; print(sys.prefix)"
  6. 6. Deactivate
    deactivate
  7. 7. Delete
    Remove-Item -Recurse -Force .venv
  • If activation fails with "running scripts is disabled on this system", allow local scripts once: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser (or for this window only: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process).
⚡

Exemples rapides

Des entrées typiques et les résultats produits par cet outil.

Create
PowerShell, Python 3.12
py -3.12 -m venv .venv
Windows
PowerShell activate
.\.venv\Scripts\Activate.ps1
macOS/Linux
bash / zsh activate
source .venv/bin/activate
fish
fish activate
source .venv/bin/activate.fish
uv
uv, Python 3.12
uv venv .venv --python 3.12
📖

Présentation

This Python venv command builder writes the commands for a virtual environment for the shell you actually use. Activation is where most people get stuck: it is Scripts\activate.bat in cmd, Scripts\Activate.ps1 in PowerShell, bin/activate in bash and zsh, and bin/activate.fish in fish. Pick the shell and you get create, activate, upgrade pip, install requirements, check, deactivate and delete commands in order, each with its own Copy button.

The interpreter is chosen correctly per platform: the py launcher with a version (py -3.12) on Windows and python3 or python3.12 on macOS and Linux. Options cover the folder name, --system-site-packages and installing a requirements file. Switch to the uv or conda tab to get the equivalent commands for those tools, including uv venv --python and conda create -n.

Notes explain the usual errors, such as the PowerShell execution policy message and the missing python3-venv package on Debian and Ubuntu. Nothing is executed; the commands are generated in your browser.

Pourquoi utiliser cet outil ?

  • Right activate command for every shell
  • Fixes the PowerShell "scripts disabled" error
  • Pick a Python version the right way
  • Same workflow for venv, uv and conda
  • Copy each step or the whole setup
⭐

Fonctionnalités

🪟

Four shells

Windows cmd and PowerShell, bash/zsh on macOS and Linux, and fish.

🐍

Version selection

py -3.12 on Windows, python3.12 elsewhere, or uv venv --python 3.12 and conda python=3.12.

📦

Full lifecycle

Create, activate, upgrade pip, install requirements, check, deactivate and delete.

⚡

uv and conda tabs

Equivalent commands for uv (with --seed) and conda (named environments).

🛡️

Execution policy help

Shows the Set-ExecutionPolicy command PowerShell needs before Activate.ps1 can run.

📋

Copy per step

Every command has its own Copy button, plus one for the whole setup.

🛠️

Mode d'emploi

1

Choose the tool

Pick venv (built in), uv or conda.

2

Choose your shell

Select PowerShell, cmd, bash/zsh or fish.

3

Set the options

Enter the folder name, an optional Python version and a requirements file.

4

Run the steps

Copy the commands in order into your terminal.

🤔

Questions fréquentes