Results 1 to 3 of 3

Thread: could not find _PyGObject_API object

  1. #1

    Default could not find _PyGObject_API object

    Hello,

    I am using OpenSUSE 12.1 (x86_64) and when I execute a python script that uses PyGTK I receive the error:
    Code:
    ImportError: could not import gobject (could not find _PyGObject_API object)
    The script uses matplotlib but I think the error is not specific to that library.
    The problem is reproduced by:
    Code:
    python -c "from matplotlib.backends._gtkagg import agg_to_gtk_drawable"
    I have both python-gobject and python-gobject2 installed and this page suggests that it might be the cause of the error but I don't see how can I remove either one if they are both needed by other packages:
    Code:
    net@linux-q4qx:~> zypper info --requires python-gobject
    Loading repository data...
    Reading installed packages...
    
    
    Information for package python-gobject:
    
    Repository: openSUSE-12.1-Update
    Name: python-gobject
    Version: 3.0.2-2.3.1
    Arch: x86_64
    Vendor: openSUSE
    Installed: Yes
    Status: up-to-date
    Installed Size: 1.3 MiB
    Summary: Python bindings for GObject
    Description: 
    Pygobjects is an extension module for python that gives you access to
    GLib's GObjects.
    Requires:
    libc.so.6()(64bit)
    libc.so.6(GLIBC_2.2.5)(64bit)
    libc.so.6(GLIBC_2.4)(64bit)
    libc.so.6(GLIBC_2.14)(64bit)
    libc.so.6(GLIBC_2.3.4)(64bit)
    libpthread.so.0()(64bit)
    libpthread.so.0(GLIBC_2.2.5)(64bit)
    libglib-2.0.so.0()(64bit)
    libgobject-2.0.so.0()(64bit)
    /usr/bin/env
    typelib(GLib)
    typelib(GObject)
    libgirepository-1.0.so.1()(64bit)
    typelib(cairo)
    libffi.so.4()(64bit)
    libpyglib-gi-2.0-python.so.0()(64bit)
    python(abi) == 2.7
    python == 2.7
    Code:
    net@linux-q4qx:~> zypper info --requires python-gobject2
    Loading repository data...
    Reading installed packages...
    
    
    Information for package python-gobject2:
    
    Repository: openSUSE-12.1-Oss
    Name: python-gobject2
    Version: 2.28.6-9.1.3
    Arch: x86_64
    Vendor: openSUSE
    Installed: Yes
    Status: up-to-date
    Installed Size: 1.2 MiB
    Summary: Python bindings for GObject
    Description: 
    Pygobjects is an extension module for python that gives you access to
    GLib's GObjects.
    Requires:
    libc.so.6()(64bit)
    libc.so.6(GLIBC_2.2.5)(64bit)
    libc.so.6(GLIBC_2.4)(64bit)
    libc.so.6(GLIBC_2.3.4)(64bit)
    /sbin/ldconfig
    libc.so.6(GLIBC_2.14)(64bit)
    libpthread.so.0()(64bit)
    libpthread.so.0(GLIBC_2.2.5)(64bit)
    libglib-2.0.so.0()(64bit)
    libgobject-2.0.so.0()(64bit)
    /usr/bin/env
    libgio-2.0.so.0()(64bit)
    libgthread-2.0.so.0()(64bit)
    libffi.so.4()(64bit)
    libpyglib-2.0-python.so.0()(64bit)
    rpmlib(CompressedFileNames) <= 3.0.4-1
    rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    rpmlib(PayloadIsLzma) <= 4.4.6-1
    rpmlib(PartialHardlinkSets) <= 4.0.4-1
    python(abi) == 2.7
    python == 2.7
    What can I do to make python (2.7.2) import the gobject successfully?

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: could not find _PyGObject_API object

    On 2012-06-16 11:36, someuser77 wrote:
    > What can I do to make python (2.7.2) import the gobject successfully?


    Perhaps you should ask in the programming forum.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  3. #3
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: could not find _PyGObject_API object

    Looks to me that your installation is damaged.
    _PyGObject_API is defined in
    /usr/lib64/python2.7/site-packages/gobject/_gobject.so
    Check that that file exists, it is part of python-gobject2 which is
    installed on your system.

    Probably do a forced reinstall of python-gobject2 in yast.

    --
    PC: oS 12.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
    ThinkPad E320: oS 12.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
    eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •