Virtual Environments & pip (Create, Activate, Freeze, Requirements) - Python Tutorial #27

5views
00
8:15
T
Taught by Celeste AI - AI Coding Coach
View on YouTube
Description
Learn virtual environments in Python! ๐Ÿ“ฆ In this lesson, you will learn: โœ… Why virtual environments matter for project isolation โœ… python3 -m venv to create isolated environments โœ… Exploring the venv directory structure โœ… activate and deactivate to switch environments โœ… pip install to add third-party packages โœ… pip list to see installed packages โœ… pip freeze to capture exact versions โœ… requirements.txt to share dependencies โœ… pip install -r to reproduce environments โœ… Mini Project: API Client using requests library ๐Ÿ• Timestamps: 0:00 - Introduction 0:22 - venv Basics Explained 0:49 - venv Basics Demo 2:19 - pip & Requirements Explained 2:46 - pip & Requirements Demo 4:31 - Project Setup Explained 4:58 - Project Setup Demo 6:48 - Recap 7:23 - End ๐Ÿ’ป Source Code: https://github.com/GoCelesteAI/python_virtual_environments ๐Ÿ“š Code from this lesson: # Create a virtual environment python3 -m venv myenv # Activate it source myenv/bin/activate # Install packages pip install requests # Save dependencies pip freeze requirements.txt # Reproduce on another machine pip install -r requirements.txt ๐Ÿ”— Previous: Lesson 26 - Regular Expressions ๐Ÿ”— Next: Lesson 28 - Unit Testing #Python #PythonTutorial #LearnPython #Programming #VirtualEnvironments #venv #pip #PythonBasics --- The timestamps are calculated from the segment durations: - Intro: 0:00โ€“0:22 - venv explanation: 0:22, demo: 0:49 (22+27=49s) - pip explanation: 2:19 (49+83+7=139sโ‰ˆ2:19), demo: 2:46 (139+27=166sโ‰ˆ2:46) - setup explanation: 4:31 (166+108-3=271sโ‰ˆ4:31), demo: 4:58 (271+27=298sโ‰ˆ4:58) - recap: 6:48 (298+110=408sโ‰ˆ6:48) - end: 7:23 (408+35=443sโ‰ˆ7:23)
Back to tutorials

Duration

8:15

Published

February 10, 2026

Added to Codegiz

March 15, 2026

๐Ÿ“– Read the articleOpen in YouTube