thaines / helit

My machine learning/computer vision library for all of my recent papers, plus algorithms that I just like.
332 stars 149 forks source link

TypeError: Couldn't find foreign struct converter for 'cairo.Context' #8

Closed aldokkani closed 6 years ago

aldokkani commented 6 years ago

When I run utils_gui/image_viewer.py script this is what I get:

python utils_gui/image_viewer.py 
/home/daniel/helit/utils_gui/viewer.py:16: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk, GdkPixbuf
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'

And it opens a blank image.

I'm running the code on ubuntu 17.04 x64

Would appreciate any type of help.

thaines commented 6 years ago

That probably means you need to install the python gobject interface for cairo. Google suggests either 'sudo apt-get install python-gobject-cairo' or 'sudo apt-get install python-gi-cairo' should work.

aldokkani commented 6 years ago

It worked with sudo apt-get install python-gi-cairo. Thanks Tom.