Red Hat Bugzilla – Bug 850915
Python does not search in /usr/local for Python libraries
Last modified: 2012-08-23 20:44:54 EDT
I want to install some system-wide Python libraries that are not part of the Fedora distribution. The standard way to make this happen is to put them in this directory:
But Fedora's python does not search in /usr/local/anywhere for .py files. I could set PYTHONPATH in /etc/profile.d somewhere, but sometimes I need to run python3, and $py_version_short is not expanded by Python in the PYTHONPATH variable (which is likely as it should be).
Version-Release number of selected component (if applicable):
Every time I run Python
Steps to Reproduce:
1.Use easy_install --prefix=/usr/local to install a site-wide Python package
3.Try to import something from the newly installed pacakge
Not able to find the package to import
Successful import of the new package
My current solution is to change this line in /usr/lib64/python$py_version_short/site.py
PREFIXES = [sys.prefix, sys.exec_prefix]
PREFIXES = [sys.prefix, sys.exec_prefix, '/usr/local']
This seems ugly, and I'm worried about that file being over-written when I upgrade the python-libs package.
This is a duplicate of this other bug. I would still really like this fixed.
*** This bug has been marked as a duplicate of bug 662034 ***