Using site-packages with alt-installed Python version

Alister alister.ware at ntlworld.com
Sun May 16 07:38:12 EDT 2010


On Sun, 16 May 2010 12:07:08 +0300, Tuomas Vesterinen wrote:

> I am testing an application GUI with Python 2.4, 2.5 and 2.6. The native
> Python (in Fedora 12) is 2.6. Versions 2.4 and 2.5 are alt-installed.
> 
> Aplication GUI uses:
> import pygtk
> pygtk.require('2.0')
> import gtk
> import gobject
> 
> I go to:
> $ cd /usr/local/lib/python2.4/site-packages
> 
> and say:
> $ sudo ln -s /usr/lib/python2.6/site-packages/pygtk.py pygtk.py $ sudo
> ln -s /usr/lib/python2.6/site-packages/gtk-2.0 gtk-2.0
> 
> and try:
> $ python2.4 gui_utils.py
> Traceback (most recent call last):
>    File "gui_utils.py", line 57, in ?
>      import gtk
>    File
> "/usr/local/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line
> 30, in ?
>      import gobject as _gobject
>    File
> "/usr/local/lib/python2.4/site-packages/gtk-2.0/gobject/__init__.py",
> line 26, in ?
>      from glib import spawn_async, idle_add, timeout_add,
> timeout_add_seconds, \
>    File
> "/usr/local/lib/python2.4/site-packages/gtk-2.0/glib/__init__.py", line
> 22, in ?
>      from glib._glib import *
> ImportError: /usr/lib/libpyglib-2.0-python.so.0: undefined symbol:
> _PyObject_CallFunction_SizeT
> 
> What I should say more to get access to the GTK?
> 
> Tuomas Vesterinen

I am not a great expert on this But I think you need to use the Redhat 
alternatives system to switch between versions rather than trying to 
change things manually.

as i understand it the Alternatives system sets up and changes various 
symlinks to ensure everything works correctly. 



-- 
"When the going gets tough, the tough get empirical."
		-- Jon Carroll



More information about the Python-list mailing list