← Tous les guides
Python development environment on Windows
Install Python via winget and set up an isolated virtual environment per project -- the standard, officially recommended way to avoid dependency conflicts between projects.
Système : Windows 10 2004+ or Windows 11DevelopmentProgrammingSite officiel ↗Documentation officielle ↗
Ce guide est élaboré à partir de la documentation officielle de Python development environment on Windows, dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
1Install Python via WinGet
winget install --id Python.Python.3.12 -eInstalling via winget (rather than the Microsoft Store listing) gets the official python.org build and avoids the Store version's sandboxing quirks.
2Verify the install in a new terminal
Open a fresh PowerShell window (so PATH changes take effect) and confirm.
python --versionpip --version3Create a virtual environment per project
Run this inside your project folder -- it creates an isolated Python + pip just for that project, so its dependencies never clash with another project's.
python -m venv .venv.venv\Scripts\Activate.ps1If PowerShell blocks the activation script with an execution-policy error, run: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
4Install packages into the active environment
pip install --upgrade pippip install <package-name>