views:

47

answers:

2

I'm using cairo plot to draw charts with python. I followed the instruction as stated on the website to install Cairplot, http://linil.wordpress.com/2008/09/16/cairoplot-11/ :

sudo apt-get install bzr
bzr branch lp:cairoplot/1.1

The installation completes successfully. I then try to import the modules in python:

 >>> import CairoPlot Traceback (most recent call last):   File "<stdin>",
 line 1, in <module> ImportError: No
 module named CairoPlot
 >>> import cairo
 >>>

Importing cairo is fine, but I can't figure out why I am not able to import CairoPlot.

A: 

Is the directory where CairoPlot is installed in your $PYTHONPATH? Do you need to run any setup scripts, like setuptools?

The repository appears to include a setup.py file, so you likely need to run setuptools to fully install the module.

Amber
+1  A: 

bzr branch lp:cairoplot/1.1 creates a directory called 1.1 in your current working directory. Inside you'll find CairoPlot.py. Move CairoPlot.py into a directory which is listed in your PYTHONPATH, or edit your PYTHONPATH to include (the unfortunately named) 1.1.

unutbu
solved it by.import sys sys.path.append("/home/rv/1.1")
Harpal