It is good practice to install python libraries into what is known as a virtual environment. An example would be a django project, and installing the django dependencies into a python virtual environment as detailed in this article
The idea is simple.
First create a virtual environment
python3 -m venv .venv