virtual environment

A self-contained folder with its own Python and its own installed packages, so each project's packages stay separate.

In more detail

Create one with python3 -m venv .venv, then activate it so that python and pip in that shell use it and installs land in that folder only. Two projects can then hold different versions of the same package. Make one per project, keep it out of version control, and rebuild it from a requirements file whenever you like.

Examples

The course installs ansible-core into a virtual environment so nothing can damage the system Python.
python3 -m venv .venv
source .venv/bin/activate

Related terms

Taught in

References

Certification courses