Python venv

From Python3 docs:

The venv module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site directories. A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python, and by default is isolated from the packages in the base environment, so that only those explicitly installed in the virtual environment are available.

See also Python pip because they are used together

It is conventionally contained in a directory named .venv and to active,

To create a new python environment and activate it:

python -m venv /path/to/new/virtual/environment
 
source <venv>/bin/activate

If you have to compile or use libraries like grpcio when running pip install -r requirements.txt, be sure to have:

python -m pip install --upgrade pip setuptools wheel

and to have like C/C++ extensions.