🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Python Beginner

What is Virtual Environment?

An isolated Python environment that maintains its own set of packages, independent of the system Python installation.

Virtual environments solve dependency conflicts between projects. Each environment has its own Python binary and package directory. Created with python -m venv or virtualenv, they ensure project A can use Django 3.2 while project B uses Django 4.1.

Activate with source venv/bin/activate (Linux/Mac) or venv\Scripts\activate (Windows). pip freeze > requirements.txt captures dependencies for reproducibility.

Related Terms

Class
A blueprint for creating objects that bundles data (attributes) and behavior (methods) together.
Enum
A built-in class for creating enumerated constants — named groups of related values that improve code readability.
List Comprehension
A concise syntax for creating new lists by applying an expression to each item in an existing iterable.
Python Context Variable
A variable that maintains separate values for each execution context, enabling implicit state passing in async code without global variables.
Decorator
A function that modifies or extends the behavior of another function or class without changing its source code.
Python Metaclass
A class whose instances are classes themselves — the class of a class that controls how classes are created and behaved.
View All Python Terms →