python import error after install new gobject-introspection

Asked by sk.liu

Hi All,
after I install new gobject-introspection-1.34.2

I try following code in python

from gi.repository import Gtk

ERROR:root:Could not find any typelib for Gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name Gtk

is there anything I missing when I install "gobject-introspection" ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu totem Edit question
Assignee:
No assignee Edit question
Solved by:
sk.liu
Solved:
Last query:
Last reply:
Revision history for this message
sk.liu (kevin631012) said :
#1

hi all ,
I try to reinstall gobject-introspection many times . python sys.path doesn't try to import the place where I installed "/usr/local/lib" .
so I add "export PYTHONPATH=/usr/local/lib/python2.7/site-packages/"
python can import "right" libraries then error messages gone .

Revision history for this message
Lord Muelllar (lord1muellar) said :
#2

This works really well for us, thank you!
https://www.mycfavisit.onl/