'pip installs modules into two paths?

I find that pip installs modules into two paths, one is ./Library/Python/3.8/lib/python/site-packages and the other is /usr/local/lib/python3.8/site-packages

Following is the evidence. And I removed a module from one of the paths, It could be still imported if it was settled in another. How does pip find the installation path?

Requirement already satisfied: pyparsing>=2.2.1 in ./Library/Python/3.8/lib/python/site-packages (from matplotlib>=3.0->arviz>=0.11.0->pymc3) (3.0.7)
Requirement already satisfied: kiwisolver>=1.0.1 in ./Library/Python/3.8/lib/python/site-packages (from matplotlib>=3.0->arviz>=0.11.0->pymc3) (1.3.2)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11.0->pymc3) (4.28.5)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11.0->pymc3) (9.0.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11.0->pymc3) (0.11.0)
Requirement already satisfied: cftime in ./Library/Python/3.8/lib/python/site-packages (from netcdf4->arviz>=0.11.0->pymc3) (1.5.0)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source