Virtual Environments & pip (Create, Activate, Freeze, Requirements) - Python Tutorial #27
5views
008:15
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
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๐ Read the articleOpen in YouTube
Duration
8:15
Published
February 10, 2026
Added to Codegiz
March 15, 2026