Bug 850915

Summary: Python does not search in /usr/local for Python libraries
Product: [Fedora] Fedora Reporter: Eric Hopper <eric-bugs2>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: bkabrda, dmalcolm, ivazqueznet, jonathansteffan, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-24 00:44:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Hopper 2012-08-22 17:45:09 UTC
Description:
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:

/usr/local/lib/python$py_version_short/site-packages

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):
python-2.7.3-7.2.fc17.x86_64

How reproducible:
Every time I run Python

Steps to Reproduce:
1.Use easy_install --prefix=/usr/local to install a site-wide Python package
2.Run python
3.Try to import something from the newly installed pacakge
  
Actual results:
Not able to find the package to import

Expected results:
Successful import of the new package

Additional info:
My current solution is to change this line in /usr/lib64/python$py_version_short/site.py

PREFIXES = [sys.prefix, sys.exec_prefix]

to read:

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.

Comment 1 Eric Hopper 2012-08-24 00:44:54 UTC
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 ***