Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185794 - dev-python/IcePy - python fails to load Ice module if /usr/lib not on search path
Summary: dev-python/IcePy - python fails to load Ice module if /usr/lib not on search ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Caleb Tennis (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-18 18:43 UTC by slowfood
Modified: 2007-07-20 19:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description slowfood 2007-07-18 18:43:43 UTC
Seems the default installation of IcePy under gentoo
has problems importing the Ice module:

Digging deeper, the problem is it can't locate /usr/lib/libIce.so
as /usr/lib is not in the default search path.
Adding /usr/lib fixes things:

but an easier way to effect this is with a Ice.pth file at the same
location as the Ice.py module top level:

Any chance of getting this in future ebuilds?

Reproducible: Always

Steps to Reproduce:
problem
    % python -c 'import Ice; print "success"'
    Traceback (most recent call last):
    File "<string>", line 1, in ?
    File "/usr/lib64/python2.4/site-packages/Ice.py", line 30, in ?
    import IcePy
    ImportError: No module named IcePy
    %


Actual Results:  
    % python -c 'import Ice; print "success"'
    success
    %


Expected Results:  
workaround
    % PYTHONPATH='/usr/lib:$PYTHONPATH' !!
    PYTHONPATH='/usr/lib:$PYTHONPATH' python -c 'import Ice; print "success"'
    success
    %

better fix
    % echo '/usr/lib' >> /usr/lib/python2.4/site-packages/Ice.pth
    % python -c 'import Ice; print "success"'
    success
    %




The Ice.pth file is used by Python to implicitly add an entry to the search path.
Seems like a good way to have the Ice.py component be able to find the libIce.so
Comment 1 Sam Jacobson 2007-07-20 11:25:25 UTC
I also experienced this bug. I would disagree with adding /usr/lib to the python path though since it's a really big directory, and most files in that directory should not be considered for import (except IcePy).

I have used a different approach in #185972 (a new ebuild for IcePy-3.2.0). It creates a symbolic link from /usr/lib/IcePy.so -> /usr/lib/python-2.x/site-packages/.
Comment 2 Caleb Tennis (RETIRED) gentoo-dev 2007-07-20 19:07:37 UTC
fixed now from 185972