View Single Post
  #1   (View Single Post)  
Old 24th June 2009
whetphish whetphish is offline
BSD Daemon
 
Join Date: Feb 2009
Location: Cluj-Napoca, Romania
Posts: 7
Unhappy Python/GTK/Cairo Problems (ImportError: No module named cairo)

Hi,

Since running an update from 7.1-RELEASE to 7.2-RELEASE and running a portupgrade yesterday I seem to have a problem with a handful of applications and was hoping someone could help me.

So far it seems to be causing problems with alacarte and gramps, but I'm sure there are other programs affected that I haven't come across yet.

Here is the error when I try to run the above programs ...

Code:
$ alacarte
Traceback (most recent call last):
  File "/usr/local/bin/alacarte", line 22, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/local/lib/python2.5/site-packages/Alacarte/MainWindow.py", line 19, in <module>
    import gtk, gmenu, gobject, gio
  File "/usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 48, in <module>
    from gtk import _gtk
ImportError: No module named cairo

$ gramps
Traceback (most recent call last):
  File "/usr/local/share/gramps/gramps.py", line 54, in <module>
    import gtk
  File "/usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 48, in <module>
    from gtk import _gtk
ImportError: No module named cairo
I've tried reinstalling py-cairo (py26-cairo-1.8.4) to no avail, but I did notice that two versions of Python are installed on my machine - 2.5 (python25-2.5.4_1) and 2.6 (python26-2.6.2).

Because the py-cairo version is 2.6 and the above two programs appear to be looking at the 2.5 version of Python, this makes me wonder whether there's some conflict going on and whether I need to set the default Python version somewhere.

In addition to the above, portversion -v reports that the port py25-bsddb-2.5.4_2 needs updating to version 2.6.2_2 but any attempts to do a portupgrade appear to go okay, but the version number stays the same.

So I'm about 90% sure that this is a Python issue. How do I set a 'default' Python? I'm positive that uninstalling 2.5 would be a bad idea as there are bound to still be programs that use it.

As always any help would be greatly appreciated.

Many thanks,
whetphish.
Reply With Quote