gedit and ssh "ImportError: No module named 'cairo'"

Short description: I want to run an instance of gedit, provided by my Ubuntu 13.10 "Server" on another Computer. It works via ssh -X, but some plugins cannot be installed (in my case it is 'Snippets').

After installing gedit and gedit-plugins none of the plugins worked. I installed dbus-x11 and most of them worked - "Snippets", unfortunately, still doesn't. Bash says:

Traceback (most recent call last): File "/usr/lib/x86_64-linux-gnu/gedit/plugins/snippets/__init__.py", line 18, in <module> from .appactivatable import AppActivatable File "/usr/lib/x86_64-linux-gnu/gedit/plugins/snippets/appactivatable.py", line 26, in <module> from .manager import Manager File "/usr/lib/x86_64-linux-gnu/gedit/plugins/snippets/manager.py", line 29, in <module> from .document import Document File "/usr/lib/x86_64-linux-gnu/gedit/plugins/snippets/document.py", line 21, in <module> import cairo
ImportError: No module named 'cairo'
(gedit:954): libpeas-WARNING **: Error loading plugin 'snippets'

when I try to select "Snippets" in the plugins preferences. Any idea what I am doing wrong?

Long description: I'm using a MacBook Air for daily work. Unfortunately there seems to be no way, to get gedit running on OS X Mavericks (or any other OS X capable of running on the MacBook). So, if anyone knows a workaround for that, it would be a possible solution to. (I've tried an older version of gedit - 2.x.x I guess - it didn't crash, but it was rather buggy.)

So I installed a "hardware friendly" Ubuntu Server via Parallels Desktop 9. I guess there are distros which are far more lightweight, but Ubuntu works really seamlessly with PD9, so I chose it.

Via XQuarts linux applications like gedit can easily be streamed over ssh. So I'm able to run gedit. But I "need" the snippets. There are of course many other text editors for Mac OS, but they cost a lot of money or are incapable of almost anything.

Best regards and thanks in advance, Markus

1

2 Answers

Try

sudo apt-get install python-cairo

or

sudo apt-get install python3-cairo
2

What i did for getting cairo installed succeessfully is;

pip install cairocffi

pip install pycairo

That worked for me.

You Might Also Like