When working with Python projects, best practice is to have a separate virtual environment for each of them.
Each virtual environment has its own Python binary. When you install some Python package into your virtual environment, it'll be installed only into that specific environment. This means that you can have different versions of a single Python package in different virtual environments in the same machine. Virtual environments are also useful if you need to use different Python versions in your projects.
You can create all your virtual environments into a single directory (for example,
.virtualenvs directory inside your home folder). This makes them easier to find.
python3 -m venv /path/to/new/environment
path/to/your/python -m venv /path/to/new/environment
After activating the newly created virtual environment, you can install new packages by using
pip. For example if you want to install
python -m pip install pytest
it'll be installed into path_to_virtual_env/lib/
You can list the installed packages and their versions by running:
python -m pip freeze