Search code examples
pythonpython-3.xgtk

python3 Gtk program throws introspection typelib error


I am trying to convert a python2 GtK program, specifically Comix, to python3 Gtk program.

I have reached a point where the program throws an error:

ImportError: cannot import name Gobject, introspection typelib not found

The error is thrown at this point:

from gi.repository import Gobject

at bookmark.py. Anyway the program itself contains various linked py files and it's not that simple to present the structure.

The funny thing is that the same import command is executed in other modules in the same program with no problem. I am not sure what's the problem here.

Some solutions mentioned as to install gir1.2-gtk-3.0 is satisfied but to no avail. Also I installed my modules using pip and to compile them using --enable-introspection=yes seems an overkill to me. There should be another solution.

Any idea what's going on here and how to deal with it?


Solution

  • module names are case sensitive, try this instead:

    from gi.repository import GObject