Re: ERROR:root:Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded



----- "Robert Park" <rbpark exolucere ca> wrote:

> On Wed, Nov 17, 2010 at 10:06 AM, John Palmieri <johnp redhat com>
> wrote:
> > On your other issue, require_version is a static method, not
> something that is introspected.  Are you sure you aren't importing gtk
> (the static bindings) somewhere?  Whenever attrs are missing that is
> usually the cause.  We really should get around to checking for that.
>  The most common reason for this issue is a module like
> libchamplain-python importing it.
> 
> I do have libchamplain-python installed, is that breaking things? I
> tried uninstalling it, and my program ran, but I still experienced a
> segfault after a while (although it did seem like it took slightly
> longer to trigger the segfault).
> 
> $ ./gottengeography.py
> 
> (gottengeography.py:5122): ClutterGLX-CRITICAL **: Unable to make the
> stage window 0x4800008 the current GLX drawable
> 
> ** (gottengeography.py:5122): CRITICAL **:
> champlain_map_source_fill_tile: assertion `CHAMPLAIN_IS_MAP_SOURCE
> (map_source)' failed
> /usr/lib64/python2.7/site-packages/gtk-2.0/gi/types.py:40: Warning:
> g_object_unref: assertion `G_IS_OBJECT (object)' failed
>   return info.invoke(*args)
> 
> ** (gottengeography.py:5122): CRITICAL **:
> champlain_map_source_fill_tile: assertion `CHAMPLAIN_IS_MAP_SOURCE
> (map_source)' failed
> 
> ** (gottengeography.py:5122): CRITICAL **:
> champlain_map_source_fill_tile: assertion `CHAMPLAIN_IS_MAP_SOURCE
> (map_source)' failed
> Segmentation fault (core dumped)
> 
> You can look at my code right here:
> 
> https://github.com/robru/GottenGeography/blob/master/gottengeography.py
> 
> I'm not explicitly importing any static bindings anywhere, all the
> imports are right at the beginning there. If libchamplain is
> importing
> the static bindings, I'm not sure how I'd get it to stop (I wasn't
> able to get your example of using GtkClutter instead of GtkChamplain
> working). Also, there's this:
> 
>  $ python
> Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
> [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more
> information.
> >>> from gi.repository import Gtk
> >>> Gtk.require_version('2.0')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/module.py",
> line
> 212, in __getattr__
>     attribute = getattr(self._dynamic_module, name)
>   File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/module.py",
> line
> 88, in __getattr__
>     self.__class__.__name__, name))
> AttributeError: 'DynamicModule' object has no attribute
> 'require_version'
> >>>
> 
> This indicates to me that something is broken with the way Gtk ships
> on Fedora 14. Or at least with the particular set of packages I have
> installed. Do you have any insight into which packages I should have
> and which I don't? When I was installing F14 I installed a lot of
> packages that looked like they would be necessary, such as
> libchamplain-python, but that turned out to not be necessary at all.
> I
> wonder what other packages have important sounding names that I
> installed unnecessarily. Could they be breaking things subtly?
> 
> Thanks.
> 
> -- 
> http://exolucere.ca

Oh, ya, Fedora 14 ships with a really old version of PyGObject Introspection.  You are not going to see a newer version until Fedora 15.  This is because the GObject Introspection ABI changed after the freeze.  This is the price of playing on the cutting edge.  I suggest running rawhide in a virtual host or using jhbuild to build a buildroot.  We are committed to stabilizing introspection in the next 5 months (well we freeze in 2 to 3 months).   Until then there is going to be pain like this.

--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]