Bug 850915 - Python does not search in /usr/local for Python libraries
Summary: Python does not search in /usr/local for Python libraries
Keywords:
Status: CLOSED DUPLICATE of bug 662034
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-22 17:45 UTC by Eric Hopper
Modified: 2012-08-24 00:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-24 00:44:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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 ***


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