A virtual environment is a self-contained directory that contains all the necessary executables to use the packages that a Python project would need.