Search code examples
pythonuser-interfacegtk3pygobject

Why my gi.repository.Gtk keeps using GTK 2 modules?


I'm designing a GUI python program and I decided to use GTK+3.

Reading some docs here: http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html I know that I could use the gi.repository.Gtk module as API to GTK+3 libs.

But while I'm trying to do so it keeps warning me that it is using the GTK+2 module:

>>> import gi.repository.Gtk
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:47: RuntimeWarning: 
You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed 
for use with introspection some of the interfaces and API will fail.
As such this is not supported by the pygobject development team and
we encourage you to port your app to Gtk 3 or greater. PyGTK is the
recomended python module to use with Gtk 2.0
 warnings.warn(warn_msg, RuntimeWarning)

I didn't know how to solve this problem... How could I really turn to using the GTK+3 ?


Solution

  • Check you have installed the development packages for GTK+ 3. In your case, with Ubuntu 12.04, you should have installed libgtk-3-dev.