0

I get an error

Couldn't find conversion for foreign struct 'cairo.Context' in <module 'threading' from '/usr/lib.python2.7/threading.pyx'> ignored

All the research I've done online suggests that there is a missing package python-gi-cairo, or python-gobject.

I've installed all of these dependencies yet still receive the message. I've made sure that I had python-gi-cairo, python3-gi-cairo, python-gobject, libcairo-gobject2, etc, installed. Other bindings have been working just fine for me until I started to try to use the Gtk.DrawingArea.

Here's the code:

from gi.repository import Gtk, Gdk
class MyExample(object): 
  def __init__(self, user_data=None): 
    window = Gtk.Window() 
    window.connect("destroy", Gtk.main_quit) 
    drawing_area = Gtk.DrawingArea() 
    drawing_area.set_size_request(300,300) 
    drawing_area.connect('draw',self.expose) 
    window.add(drawing_area) 
    window.show_all()  
  def expose(self,widget,cr,data): 
    print ("self_exposed") 
# === 
if __name__ == "__main__": 
    app = MyExample() 
    Gtk.main() 

I get the same error running this with python2 and python3. If i open up a Python shell and type "import cairo", there are no errors. I can't find any information about this on the internet that I haven't already read. Any ideas?

I'm running Ubuntu 13.10. I've updated apt-get, removed and reinstalled python-gi-cairo, etc.

sugarmuff
  • 435
  • 5
  • 17

1 Answers1

0

The only way I was able to resolve the issue was by reformatting and reinstalling Ubuntu. Somehow my installation got screwed up, but no amount of uninstalling/reinstalling packages ever yielded any progress.

sugarmuff
  • 435
  • 5
  • 17