ImportError: No module named glib

Discussion in 'Python' started by Michael Joachimiak, Mar 5, 2010.

  1. 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
     
    Michael Joachimiak, Mar 5, 2010
    #1
    1. Advertisements

  2. Michael Joachimiak

    Peter Otten Guest

    Michael Joachimiak wrote:

    > 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


    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.
    >>> import glib
    >>> glib.__file__

    '/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
     
    Peter Otten, Mar 5, 2010
    #2
    1. Advertisements

  3. Michael Joachimiak

    hanu

    Joined:
    Jun 20, 2013
    Messages:
    1
    Likes Received:
    0
    hi guys ... i am facing the same problem .. plz help
     
    hanu, Jun 20, 2013
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry George
    Replies:
    0
    Views:
    6,020
    Harry George
    Jul 15, 2003
  2. Carsten Gehling

    pso - ImportError: No module named url

    Carsten Gehling, Jul 16, 2003, in forum: Python
    Replies:
    0
    Views:
    550
    Carsten Gehling
    Jul 16, 2003
  3. Carsten Gehling

    SV: pso - ImportError: No module named url

    Carsten Gehling, Jul 16, 2003, in forum: Python
    Replies:
    0
    Views:
    639
    Carsten Gehling
    Jul 16, 2003
  4. x-herbert
    Replies:
    2
    Views:
    2,655
    x-herbert
    Aug 8, 2003
  5. Adam Jack
    Replies:
    0
    Views:
    497
    Adam Jack
    Aug 8, 2003
  6. Matt Smith

    Importerror no module named WIN32API

    Matt Smith, Aug 11, 2003, in forum: Python
    Replies:
    3
    Views:
    7,759
    Matt Smith
    Aug 12, 2003
  7. Wicked
    Replies:
    0
    Views:
    821
    Wicked
    Aug 14, 2003
  8. eric_bellard
    Replies:
    1
    Views:
    5,543
    CarlosRivera
    Oct 7, 2004
Loading...