Glib import error

When trying to import glib into python 3 using from gi.repository import glib

, I get the error:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 2135, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 53, in find_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name glib, introspection typelib not found

      

I have installed all glib / dev python packages using apt-get on Ubuntu 14.04. Trying to import a module in python 2 says the module doesn't exist.

How to fix it?

+3


source to share


1 answer


It works for me with GLib

properly capitalized:



from gi.repository import GLib

      

+2


source







All Articles