0

I installed ubuntu 12.04 64-bit I have python 2.7 with some additional packages. When I try to use simple command in python like for example help('modules') I have an error and python terminates.

    >>> help('modules')
Please wait a moment while I gather a list of all available modules...
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  from gtk import _gtk

** (python:2729): CRITICAL **: pyg_register_boxed: assertion `boxed_type != 0' failed
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: cannot register existing type `GdkDevice'
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Segmentation fault (core dumped)

In addition I cannot install matplotlib. In a long error log, apart of other stuff I have:

            pkg-config: looking for pygtk-2.0 gtk+-2.0

                        * Package pygtk-2.0 was not found in the pkg-config

                        * search path. Perhaps you should add the directory

                        * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH

                        * environment variable No package 'pygtk-2.0' found

                        * Package gtk+-2.0 was not found in the pkg-config

                        * search path. Perhaps you should add the directory

                        * containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH

                        * environment variable No package 'gtk+-2.0' found

                        * You may need to install 'dev' package(s) to

                        * provide header files.

                  Gtk+: no

                        * Could not find Gtk+ headers in any of

                        * '/usr/local/include', '/usr/include',

                        * '/usr/local/include', '/usr/include', '.'

I tried to install gtk from synaptic but did not find exact match for gtk and installed libraries with its dependencies which I thought are the closest. I am not sure how to test if I have it correctly installed and how to fix my python's problem

1
  • Why has this not been resolved? This bug has been ongoing since 2011. What the!? Basic python functionality broken, and the only answer provided is "don't use help()"?
    – user412867
    May 23, 2015 at 1:21

1 Answer 1

3

To build and install matplotlib you'll need to install the necessary dependencies. In this particular case, it seems you are missing python-gtk2-dev.

As for the crash with help('modules') in python, it is likely that it is trying to load both the introspected bindings, as well as the old static bindings; and that will cause a crash as there are conflicting symbols in the incompatible libraries they support.

3
  • Thanks a lot it resolve matplotlib problem. Now when I try help('modules') I have different error and python freezes. Warning: cannot register existing type GdkDisplayManager'from import osk Warning: g_once_init_leave: assertion result != 0' failed from . import osk Warning: g_type_register_static: assertion parent_type > 0' failed from . import osk` Warning: g_object_new: assertion G_TYPE_IS_OBJECT (object_type)' failed from . import osk Can you advise me how to resolve it?
    – tomasz74
    Nov 9, 2012 at 18:00
  • The behavior of importing multiple versions of a library which are incompatible with each other, in the same process, is basically undefined. My advise would be to not do help('modules') as it tries to load everything which is installed in python, and thus will have undefined behavior.
    – dobey
    Nov 9, 2012 at 19:27
  • Thanks for your help. really appreciated. Will try to work out about this libraries, hopefully it will not cause any major problems.
    – tomasz74
    Nov 9, 2012 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .