View Single Post
Old 03-18-2012, 01:06 PM   #1
sjvs
Enthusiast
sjvs began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2012
Device: Sony PRS-T1
Developing plugin to process notes from Sony PRS-T1: no module named

Hi all,

I'm developing a Calibe plugin to import/export notes from a Sony PRS-T1 device. My first goal is to be able to "merge" handwritten annotations with the original pdf, using the "cairo" and "rsvg" libraries.

The user interface and SQLite bits are in place, but I can't seem to do "import cairo" or "import rsvg" in my plugin, because Calibre will tell me:
Quote:
Traceback (most recent call last):
File "site-packages/calibre/gui2/ui.py", line 123, in __init__
File "site-packages/calibre/gui2/ui.py", line 137, in init_iaction
File "site-packages/calibre/customize/__init__.py", line 543, in load_actual_plugin
File "importlib/__init__.py", line 37, in import_module
File "site-packages/calibre/customize/zipplugin.py", line 150, in load_module
File "calibre_plugins.prst1_notes.ui", line 18, in <module>
File "site-packages/calibre/customize/zipplugin.py", line 150, in load_module
File "calibre_plugins.prst1_notes.main", line 27, in <module>
File "site-packages/calibre/customize/zipplugin.py", line 150, in load_module
File "calibre_plugins.prst1_notes.PRST1NotesPDFMergeInt erface", line 6, in <module>
ImportError: No module named cairo
However, the cairo and rsvg python libraries are in place on my system (Ubuntu 11.10), and working for other (standalone) Python applications.

I tried calibre-debug, same result:
Quote:
$ calibre-debug -c "import cairo"
Traceback (most recent call last):
File "site.py", line 58, in main
File "site-packages/calibre/debug.py", line 216, in main
File "<string>", line 1, in <module>
ImportError: No module named cairo
Am I overlooking something? I'm running Python 2.7.2.

Many thanks for your help!
sjvs is offline   Reply With Quote