[cairo] help needed in compiling python code

Steve Chaplin stevech1097 at yahoo.com.au
Mon Dec 13 23:45:21 PST 2004

On Tue, 2004-12-14 at 02:27 +0530, gopinaths wrote:
> Hi,
>     I'm having trouble executing example codes in examples/ in the
> pycairo-0.1.3 package.
> # ./cairo-demo.py
> Traceback (most recent call last):
>   File "./cairo-demo.py", line 4, in ?
>     import gtk
> ImportError: No module named cairo._cairo
> cairo modules are available in /etc/lib/python/site-packages/
> Could someone help me with the compile error..
> thankx
This looks like a PYTHONPATH problem. I've updated the README in cvs to
help with this problem:

    $ python -c "import sys; print sys.prefix"
        # make a note of the python prefix
    $ ./configure --prefix=<python_prefix>
    $ make
    $ make install

If you're installing to another prefix than the one where python is
installed Python will not be able to find the cairo module until you add
$prefix/lib/pythonX.Y/site-packages to the PYTHONPATH variable.


More information about the cairo mailing list