xpressor package dependency GI not working

Bug #1086180 reported by Orion Fillmore
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xpresser
Confirmed
Undecided
Unassigned

Bug Description

root@steropes:~# apt-get install python-xpresser
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  python-xpresser
0 upgraded, 1 newly installed, 0 to remove and 124 not upgraded.
Need to get 0 B/8,594 B of archives.
After this operation, 75.8 kB of additional disk space will be used.
Selecting previously unselected package python-xpresser.
(Reading database ... 87291 files and directories currently installed.)
Unpacking python-xpresser (from .../python-xpresser_1.1.4-1_all.deb) ...
Setting up python-xpresser (1.1.4-1) ...
root@steropes:~# python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xpresser
libdc1394 error: Failed to initialize libdc1394
ERROR:root:Could not find any typelib for Gdk
ERROR:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/xpresser/__init__.py", line 21, in <module>
    from xpresser.xp import Xpresser, ImageNotFound
  File "/usr/lib/python2.7/dist-packages/xpresser/xp.py", line 22, in <module>
    from xpresser import xutils
  File "/usr/lib/python2.7/dist-packages/xpresser/xutils.py", line 26, in <module>
    from gi.repository import Gdk
ImportError: cannot import name Gdk
ERROR:Main Logger:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/xpresser/__init__.py", line 21, in <module>
    from xpresser.xp import Xpresser, ImageNotFound
  File "/usr/lib/python2.7/dist-packages/xpresser/xp.py", line 22, in <module>
    from xpresser import xutils
  File "/usr/lib/python2.7/dist-packages/xpresser/xutils.py", line 26, in <module>
    from gi.repository import Gdk
ImportError: cannot import name Gdk

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

Are you running something other than Ubuntu? like Kubuntu or Xubuntu? It seems like you're missing python-gi.

Try: apt-get install python-gi

Revision history for this message
Orion Fillmore (ofillmore) wrote :

Thanks for your reply. I am running an ubuntu server 12.04 and already have python-gi installed. Technically, the problem lies within gi...there is no GDK present in the repository folder inside the GI module...but xpresser is dependant upon it. Any ideas on how to get this working?

Revision history for this message
Little Girl (littlergirl) wrote :

I've had a similar experience on a smaller scale:

(1) I use Kubuntu Precise Pangolin LTS.

(2) I went to this page:

https://wiki.ubuntu.com/Xpresser

(3) I used the information from the "Getting started" section in that page to install Xpresser from the package manager after adding its PPA to my sources.

(4) I copied this from the "Fire it up" and "Clicking somewhere" sections of that page and changed the path and file name to point to an image on my Desktop:

from xpresser import Xpresser
xp = Xpresser()
xp.load_images("/home/littlegirl/Desktop")
xp.click("exampleimage")

(5) I saved it as example.py on my Desktop.

(6) I opened a terminal window on my Desktop.

(7) I ran this command in the terminal window:

python2.7 example.py

(8) I got this result:

ERROR:root:Could not find any typelib for Gdk
Traceback (most recent call last):
  File "example.py", line 1, in <module>
    from xpresser import Xpresser
  File "/usr/lib/python2.7/dist-packages/xpresser/__init__.py", line 21, in <module>
    from xpresser.xp import Xpresser, ImageNotFound
  File "/usr/lib/python2.7/dist-packages/xpresser/xp.py", line 22, in <module>
    from xpresser import xutils
  File "/usr/lib/python2.7/dist-packages/xpresser/xutils.py", line 26, in <module>
    from gi.repository import Gdk
ImportError: cannot import name Gdk

(9) I found a bug report on "xpressor package dependency GI not working " on this page:

https://bugs.launchpad.net/xpresser/+bug/1086180

It looks very much like the error I'm getting.

(10) The only help the person was given was the suggestion to make sure python-gi is installed.

(11) On my machine, python-gi and python2.7 are installed:

$ dpkg --get-selections python-gi
python-gi install

$ dpkg --get-selections python2.7
python2.7 install

I've got the girepository:

$ locate girepository
/usr/lib/girepository-1.0
/usr/lib/libgirepository-1.0.so.1
/usr/lib/libgirepository-1.0.so.1.0.0
/usr/lib/girepository-1.0/GIRepository-2.0.typelib
/usr/lib/girepository-1.0/GLib-2.0.typelib
/usr/lib/girepository-1.0/GModule-2.0.typelib
/usr/lib/girepository-1.0/GObject-2.0.typelib
/usr/lib/girepository-1.0/Gio-2.0.typelib
/usr/share/doc/libgirepository-1.0-1
/usr/share/doc/libgirepository-1.0-1/AUTHORS
/usr/share/doc/libgirepository-1.0-1/NEWS.gz
/usr/share/doc/libgirepository-1.0-1/README
/usr/share/doc/libgirepository-1.0-1/TODO
/usr/share/doc/libgirepository-1.0-1/changelog.Debian.gz
/usr/share/doc/libgirepository-1.0-1/copyright
/var/lib/dpkg/info/libgirepository-1.0-1.list
/var/lib/dpkg/info/libgirepository-1.0-1.md5sums
/var/lib/dpkg/info/libgirepository-1.0-1.postinst
/var/lib/dpkg/info/libgirepository-1.0-1.postrm
/var/lib/dpkg/info/libgirepository-1.0-1.shlibs
/var/lib/dpkg/info/libgirepository-1.0-1.symbols

Yet I'm still getting the error(s) as seen in step (8) above.

Changed in xpresser:
status: New → Confirmed
Revision history for this message
Little Girl (littlergirl) wrote :

I found this Stack Overflow page:

http://stackoverflow.com/questions/7823972/cant-import-webkit-from-gi-repository

It had instructions for a solution to a WebKit problem instead of a Gdk problem, but it seemed similar.

I copied the instructions and:
 - replaced locate girepository | grep WebKit with locate girepository | grep Gdk
 - replaced sudo apt-get install gir1.2-webkit-3.0 with sudo apt-get install gir1.2-gdkpixbuf-2.0
 - replaced gi.require_version('WebKit', '3.0') with gi.require_version('Gdk', '2.0')
 - replaced from gi.repository import WebKit with from gi.repository import Gdk

 After I was done doing that, I ran sudo apt-get update to hopefully make sure the system knew it got something new and exciting.

When I tried to run my script again, I got the same error as in step (8) above.

I uninstalled the gir1.2-gdkpixbuf-2.0 package and got rid of the extra lines I'd added to my script, and I guess I'll wait to try it again when someone suggests something new to try in here.

Revision history for this message
Little Girl (littlergirl) wrote :

This page may be of use to someone:

http://askubuntu.com/questions/270011/broken-python-2-7-after-manually-building-and-installing-python-2-6

Some of it looks downright dangerous to try, but I'm still learning. (:

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

do you have the python-gobject package installed?

Revision history for this message
Little Girl (littlergirl) wrote :

Yep!

dpkg --get-selections python-gobject
python-gobject install

Let me know if there's anything else you'd like me to try. (:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.