ImportError: No module named glib

  • Thread starter Michael Joachimiak
  • Start date
M

Michael Joachimiak

I am too new to python.
If anybody has an idea what to do please help.
when I use

import glib

in my code I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named glib

:~$ python -V
Python 2.6.4

/usr/lib/libpyglib-2.0-python2.6.so.0.0.0 exists in version 2.18.0-0ubuntu2

:~$ pkg-config glib-2.0 --cflags --libs
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
 
P

Peter Otten

Michael said:
I am too new to python.
If anybody has an idea what to do please help.
when I use

import glib

in my code I get this:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named glib

:~$ python -V
Python 2.6.4

/usr/lib/libpyglib-2.0-python2.6.so.0.0.0 exists in version
2.18.0-0ubuntu2

:~$ pkg-config glib-2.0 --cflags --libs
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0

After the following random walk through my system

$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.'/usr/lib/pymodules/python2.6/gtk-2.0/glib/__init__.pyc'

In the above __init__.py:
....
from glib._glib import *
_PyGLib_API = _glib._PyGLib_API

del _glib
....
import sys
sys.modules["glib._glib"]
<module 'glib._glib' from
'/usr/lib/pymodules/python2.6/gtk-2.0/glib/_glib.so'>$ dpkg -S _glib.so
python-gobject: /usr/lib/pyshared/python2.5/gtk-2.0/glib/_glib.so
python-gobject: /usr/lib/pyshared/python2.6/gtk-2.0/glib/_glib.so
$

.... I believe that you have to install the python-gobject package.

Peter
 
Joined
Jun 20, 2013
Messages
1
Reaction score
0
I am too new to python.
If anybody has an idea what to do please help.
when I use

import glib

in my code I get this:

>>> import glib

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named glib

:~$ python -V
Python 2.6.4

/usr/lib/libpyglib-2.0-python2.6.so.0.0.0 exists in version 2.18.0-0ubuntu2

:~$ pkg-config glib-2.0 --cflags --libs
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
hi guys ... i am facing the same problem .. plz help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top