Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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 '12 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 '12 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 '12 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.