9

I'm following the pycairo installation instructions here : http://www.cs.rhul.ac.uk/home/tamas/development/igraph/tutorial/install.html to install pycairo for use with igraph.

However, even after running the installer and unzipping/copying all DLL's into the site-packages cairo directory according to the instructions, I still get the following error:


>>> import cairo
Traceback (most recent call last):
  File "", line 1, in 
  File "c:\Python26\lib\site-packages\cairo__init__.py", line 1, in 
    from _cairo import *
ImportError: DLL load failed: The specified module could not be found.
>>> 

I am running python 2.6.6 under Windows 7.

Any ideas?

cip
  • 93
  • 1
  • 1
  • 3

2 Answers2

20

Open _cairo.pyd in Dependency Walker and figure out what it's missing.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • Awesome! Turned out it needed a dll for freetype, which wasn't in the instructions. – cip Jan 19 '11 at 04:59
  • 7
    @cip: I'm the guy who should be blamed for those instructions; can you please tell me the name of the missing DLL and where did you get it from? I'm flying blind here as I don't have a Windows machine. – Tamás Jan 19 '11 at 07:54
  • 3
    @Tamas: Your tutorial has actually been extraordinarily helpful. I got the dll from the ftp site you link to - http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ the missing dll is freetype6.dll, found in freetype_2.4.4-1_win32.zip – cip Jan 19 '11 at 16:15
0

I kinda solved the problem installing the Gtk-Bundle for Windows, wich had the third party dll dependencies.

(I did a dirty solution by pasting the dlls directly into c:/Python27/lib/dist-packages/cairo, because I am not used to Windows anymore and don't know for sure what is the expected place for the dlls to go.)

But my scripts started to work at last.

heltonbiker
  • 26,657
  • 28
  • 137
  • 252
  • I don't see a directory called c:\Python27\lib. I see Lib and I see libs. Under Lib there is no "dist-packages\cairo" there is a site-packages but no cairo. There is a curl. Where is cairo supposed to come from? I placed freetype6.dll on my path and I placed it in Lib\site-packages\curl. I still get the error reported above. I'm now searching the entire C drive for something called cairo. – RichMeister Dec 23 '14 at 23:04