Getting Started with Python Virtual Environments (venv)
Getting Started with venv # 1. Create a venv (usually named .venv by convention) python3 -m venv myenv # 2. Activate - Windows (PowerShell) myenv\Scripts\Activate.ps1 # 3. Install packages - installs only into this venv pip install requests numpy # 4. Use python as typical # 5. Deactivate when done deactivate What if you close without deactivate If you close the Windows Terminal without deactivating, it’s ok. Nothing bad happens. The venv is just a folder on disk. Deactivating only removes some of the temp environment variables from your current shell session. A new console those variables are gone, effectively the same as deactivating. ...