Creating and Activating venv
Create, activate, and deactivate virtual environments with venv.
Introduction
Python's built-in venv module creates lightweight virtual environments. Activation points your shell to the venv's Python.
Creating a venv
python -m venv .venv creates a virtual environment in the .venv directory.
# Terminal:
# python -m venv .venv
# Creates: .venv/bin/python, .venv/lib/, .venv/pyvenv.cfg
print('create demo')All lessons in this course
- Why Virtual Environments Matter
- Creating and Activating venv
- Managing Dependencies with pip
- Modern Tools: pipenv and uv