0Pricing
Python Academy · Lesson

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

  1. Why Virtual Environments Matter
  2. Creating and Activating venv
  3. Managing Dependencies with pip
  4. Modern Tools: pipenv and uv
← Back to Python Academy