[TriZPUG] gtk module finds wrong libraries

David Handy david at handysoftware.com
Thu Mar 31 17:44:00 CEST 2011


It sounds like LD_LIBRARY_PATH is not working. I don't know why it is not
working for you, but some other things you could try (I haven't tested them
myself):

Since you apparently compiled Python yourself, read carefully through the
configure options and see if there is something that allows you to set the
shared libary search path to explicitly search /usr/local/lib first.

Try starting python using /lib/ld-linux.so.2, which is supposed to have the
same effect as LD_LIBRARY_PATH.
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Maybe others on this list will have better ideas than these for you to
try...

Good luck!
David H


On Thu, Mar 31, 2011 at 07:35:40AM -0700, Joseph Mack NA3T wrote:
> linux 2.6.x
> python2.6 in /usr/local/lib
> 
> I'm installing on a system with old gnome libraries (eg gtk) which
> are in /usr/lib64 (/usr/lib64 is in /etc/ld.so.conf). Due to
> administrative constraints, I have to install in /usr/local, where I
> have installed the current gnome libraries, python and its modules.
> Thus I have new libraries in /usr/local/lib and the old libraries in
> /usr/lib64. /usr/local/lib is _not_ in /etc/ld.so.conf and I handle
> finding these libraries first by having /usr/local/lib first in
> LD_LIBRARY_PATH. This works so far, except the case here.
> 
> When I import gtk I get
> 
> Python 2.6.5 (r265:79063, Jan 26 2011, 11:29:31)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>>import gtk
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/usr/local/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py",
> line 48, in <module>
>     from gtk import _gtk
> ImportError:
> /usr/local/lib/python2.6/site-packages/gtk-2.0/gtk/_gtk.so:
> undefined symbol: gtk_recent_action_get_type
> >>>
> 
> The undefined symbol is in the new gnome libraries in
> /usr/local/lib, but not in the old libraries in /usr/lib64. It seems
> that python is looking to /etc/ld.so.conf (which directs it to
> /usr/lib64) to find its libraries, rather than using
> LD_LIBRARY_PATH.
> 
> If I move the old gnome libraries in /usr/lib64 out of the way, I
> can import gtk just fine. I'm not allowed to use this as a permanent
> solution and have to restore the old libraries.
> 
> How do I get python to look in /usr/local/lib before /usr/lib64 for
> its libraries?
> 
> I haven't found anything in Beazley, although I expect I don't know
> where to look.
> 
> Thanks Joe
> -- 
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!
> _______________________________________________
> TriZPUG mailing list
> TriZPUG at python.org
> http://mail.python.org/mailman/listinfo/trizpug
> http://trizpug.org is the Triangle Zope and Python Users Group


More information about the TriZPUG mailing list