python3 site-packages doesn't list the directory where pip installed my files
Mar 09, 2019
asked by anonymous
Question / Issue:
pip3 installs files to /usr/lib/python3.7/site-packages
However:
>>> import site
>>> site.getsitepackages()
['/usr/lib64/python3.7/site-packages']
How do I add /usr/lib/python3.7/site-packages, so the packages installed by pip can be found?
Responses:
Date: March 9, 2019
Author: Mind Chasers
Comment:
One way to get around this is to create a sitecustomize.py file in /usr/lib64/python3.7/site-pacages
This will be imported and executed at startup as described in the site documentation on Python.org
Add the following lines to sitecustomize.py
import site
site.addsitedir('/usr/lib/python3.7/site-packages')