Bug 850915 - Python does not search in /usr/local for Python libraries
Python does not search in /usr/local for Python libraries
Status: CLOSED DUPLICATE of bug 662034
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Dave Malcolm
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-22 13:45 EDT by Eric Hopper
Modified: 2012-08-23 20:44 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-23 20:44:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Hopper 2012-08-22 13:45:09 EDT
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-23 20:44:54 EDT
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 ***

Note You need to log in before you can comment on or make changes to this bug.