Python for Software Engineers
Back to Modern Python Foundations

Virtual Envs & Dependency Management

Isolate per-project dependencies. The 2026 tooling: uv (recommended), poetry, pip-tools, venv. How they differ. FIND_VIDEO: search 'python virtual environment uv poetry pip-tools' — recommended channel: ArjanCodes / Real Python. Aim for 9 min or under.

9 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Virtual Environments Overview — The instructor explains why isolating dependencies per project prevents global version conflicts.
  2. Environment Creation — The instructor navigates to a project directory and uses python -m venv to generate an environment.
  3. Activation and Deactivation — The instructor demonstrates activating environments on different operating systems and deactivating them.
  4. Installing and Testing Isolation — The instructor verifies baseline packages with pip list and installs a new library locally.
  5. Exporting Dependencies — The instructor runs pip freeze to capture installed package versions into requirements.txt.
  6. Reproducing Environments — The instructor creates a fresh environment and reinstalls all dependencies using the requirements file.
  7. Best Practices and Cleanup — The instructor outlines project layout conventions and demonstrates deleting an environment folder.
PDF notes

Frequently asked questions

How do I verify that my virtual environment is currently active?

Look for the environment name in parentheses at the start of your terminal prompt, or run `pip list` to confirm only local packages appear.

What is the proper way to delete or uninstall a virtual environment?

Deactivate the environment first if it is running, then delete the entire virtual environment directory using your terminal or file explorer.

Why does a brand new virtual environment already have packages installed?

The `venv` module installs baseline management packages—namely `pip` and `setuptools`—so you can install dependencies immediately.

Should I commit the virtual environment folder to version control?

No, virtual environments contain machine-specific binaries; share only `requirements.txt` and add the environment directory to `.gitignore`.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.