[pygtk] import gtk : gives error message

varun_shrivastava shrivastavavarun at yahoo.co.in
Fri Aug 10 14:52:00 WST 2007


hi
i finally found the solution for this, for directfb 

open file pygtk-x.x/gtk/gdk.override
search "ignore" in it
than add gdk_keyval_convert_case in that block
it should than look like this
%% 
ignore
gdk_window_set_debug_updates 
gdk_region_destroy
gdk_atom_intern_static_string
gdk_pixbuf_from_pixdata
gdk_keyval_convert_case
%%

Make a change also in gtk+/gdk/directfb/gdkproperty-directfb.c
search for function gdk_atom_name and replace all statements with these
statements so that it looks like

gchar *
gdk_atom_name (GdkAtom atom) 
{
  if (!atoms_to_names)
          ensure_atom_tables();
  
 if (GPOINTER_TO_INT (atom)-1 >= atoms_to_names->len)
     return NULL;
return g_strdup(g_ptr_array_index (atoms_to_names, 
                        GPOINTER_TO_INT(atom)-1));
} 
 
after making changes first make install gtk again
than proceed as shown
1. cd pygobject && ./configure PYTHON=pythonx.x && make && make install
(x.x is version of python currently installed) 
2. cd pygtk && ./configure PYTHON=pythonx.x && make && make install



cheers
varun



varun_shrivastava wrote:
> 
> i have installed following packages in same order as shown
> 
> 1) python2.5
> 2) Glib 2.12.12
> 3) atk-1.9.1
> 4) cairo 1.4.6
> 5) pango 1.16.4
> 6) gtk+-2.10.0
> 7) pycairo 1.4.0
> 8) pygobject 2.13.1
> 9) pygtk-2.8.6
> 
> installation succeeds but while importing gtk following error is displayed
> 
> Python 2.5 (r25:51908, Jun  4 2007, 14:10:43) 
> [GCC 4.1.1] 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.5/site-packages/gtk-2.0/gtk/__init__.py",
> line 45, in <module>
>     from _gtk import *
> ImportError: /usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so:
> undefined symbol: gdk_keyval_convert_case
> 
> 
> my OS is Ubuntu Linux the edgy 6.10
> 
> thanks in advance
> 

-- 
View this message in context: http://www.nabble.com/import-gtk-%3A-gives-error-message-tf3865519.html#a12086223
Sent from the Gtk+ - Python mailing list archive at Nabble.com.



More information about the pygtk mailing list