$ python3 -m venv virtual_env
This creates the
$ cd virtual_env
$ find -name python3
./bin/python3
It also copies a bunch of other stuff: I get 650 files in 89 subdirectories amounting to
about 10 MiB in total. One of those files is the
pip binary, and we can use it to
install packages into the virtual environment without passing extra command-line
arguments:
$ ./bin/pip install left-pad
You can read more about using venv and
optional magic like “activate” scripts in the
Python tutorial or venv’s
documentation—this post is only meant to
boil down what a virtual environment actually is.
Summary