Egg/Setup.py install

220 views
Skip to first unread message

snake007uk

unread,
Jul 8, 2009, 5:50:59 AM7/8/09
to CairoPlot
Hi,

Is it possible to have a egg/setup.py install, to make it easier to
install on OSX? even if it is via macports etc...

Rodrigo Araújo

unread,
Jul 8, 2009, 7:46:28 AM7/8/09
to cair...@googlegroups.com
Hey there,

There is a setup.py file already. But I don't know if it works on Mac OSX as I've never tried it.
Download the trunk version of Cairoplot https://code.launchpad.net/~alf-rodrigo/cairoplot/trunk
If you manage to install it, please provide us with an walkthrough on how to do it so we can add it to our documentation.

Cheers,

Rodrigo Araújo

snake007uk

unread,
Jul 8, 2009, 7:53:31 AM7/8/09
to CairoPlot
Sorry im a noob, i have no idea how to get the trunk?

On Jul 8, 12:46 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> Hey there,
> There is a setup.py file already. But I don't know if it works on Mac OSX as
> I've never tried it.
> Download the trunk version of Cairoplothttps://code.launchpad.net/~alf-rodrigo/cairoplot/trunk
> If you manage to install it, please provide us with an walkthrough on how to
> do it so we can add it to our documentation.
>
> Cheers,
>
> Rodrigo Araújo
>

Rodrigo Araújo

unread,
Jul 8, 2009, 7:58:52 AM7/8/09
to cair...@googlegroups.com
Hey,

To get it, you only need to:

Open a terminal and type: bzr branch lp:cairoplot

Please, could add your name to the next message?

Thanks,

Rodrigo

snake007uk

unread,
Jul 8, 2009, 8:39:49 AM7/8/09
to CairoPlot
Sorry (my name is: Kashif)



On Jul 8, 12:58 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> Hey,
>
> To get it, you only need to:
>
> Install bazaar:http://bazaar-vcs.org/Download
> Open a terminal and type: *bzr branch lp:cairoplot*
>
> Please, could add your name to the next message?
>
> Thanks,
>
> Rodrigo
>

Rodrigo Araújo

unread,
Jul 8, 2009, 8:50:02 AM7/8/09
to cair...@googlegroups.com
Hey Kashif,

So, did you manage to get the trunk files?
What about the instalation?

Rodrigo

snake007uk

unread,
Jul 8, 2009, 9:02:08 AM7/8/09
to CairoPlot
Just a quick update this is the steps I did on my OSX via mac ports

sudo port selfupdate
sudo port install bzr
bzr branch lp:cairoplot

"your version of httplib doesn't support HTTPS"
NotImplementedError: your version of httplib doesn't support HTTPS

bzr 1.15.1 on python 2.5.4 (darwin)
arguments: ['/opt/local/bin/bzr', 'branch', 'lp:cairoplot']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_GB.UTF-8'
plugins:
launchpad /opt/local/Library/Frameworks/Python.framework/
Versions/2.5/lib/python2.5/site-packages/bzrlib/plugins/launchpad
[1.15.1]
netrc_credential_store /opt/local/Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/
plugins/netrc_credential_store [1.15.1]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.


I know the problem is with the httplib, just trying to figure out how
to go around it

snake007uk

unread,
Jul 8, 2009, 9:04:39 AM7/8/09
to CairoPlot
sorry I forgot :)

Just a quick update this is the steps I did on my OSX via mac ports

sudo port selfupdate
sudo port install bzr
bzr branch lp:cairoplot

"your version of httplib doesn't support HTTPS"
NotImplementedError: your version of httplib doesn't support HTTPS

bzr 1.15.1 on python 2.5.4 (darwin)
arguments: ['/opt/local/bin/bzr', 'branch', 'lp:cairoplot']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_GB.UTF-8'
plugins:
launchpad /opt/local/Library/Frameworks/Python.framework/
Versions/2.5/lib/python2.5/site-packages/bzrlib/plugins/launchpad
[1.15.1]
netrc_credential_store /opt/local/Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/
plugins/netrc_credential_store [1.15.1]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.

I know the problem is with the httplib, just trying to figure out how
to go around it

Thanks,

Kashif

Rodrigo Araújo

unread,
Jul 8, 2009, 9:08:40 AM7/8/09
to cair...@googlegroups.com
hehe
No problem.
Wish I could help, but I know nothing of installing things on Mac OSX...

Rodrigo

snake007uk

unread,
Jul 8, 2009, 9:11:59 AM7/8/09
to CairoPlot
I think i may know how to fix it, ill be right back :)

On Jul 8, 2:08 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> heheNo problem.
> Wish I could help, but I know nothing of installing things on Mac OSX...
>
> Rodrigo
>
> On Wed, Jul 8, 2009 at 10:04 AM, snake007uk <snake00...@gmail.com> wrote:
>
> > sorry I forgot :)
>
> > Just a quick update this is the steps I did on my OSX via mac ports
>
> > sudo port selfupdate
> > sudo port install bzr
> > bzr branch lp:cairoplot
>
> >    "your version of httplib doesn't support HTTPS"
> > NotImplementedError: your version of httplib doesn't support HTTPS
>
> > bzr 1.15.1 on python 2.5.4 (darwin)
> > arguments: ['/opt/local/bin/bzr', 'branch', 'lp:cairoplot']
> > encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_GB.UTF-8'
> > plugins:
> >  launchpad            /opt/local/Library/Frameworks/Python.framework/
> > Versions/2.5/lib/python2.5/site-packages/bzrlib/plugins/launchpad
> > [1.15.1]
> >  netrc_credential_store /opt/local/Library/Frameworks/
> > Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/
> > plugins/netrc_credential_store [1.15.1]
> > *** Bazaar has encountered an internal error.
> >    Please report a bug athttps://bugs.launchpad.net/bzr/+filebug

snake007uk

unread,
Jul 8, 2009, 9:59:36 AM7/8/09
to CairoPlot
No luck, it seems i am stuck :(

Is there no other way of installing the module manually?

Thanks

Kashif

Rodrigo Araújo

unread,
Jul 8, 2009, 10:02:20 AM7/8/09
to cair...@googlegroups.com
It's possible to download each file on the launchpad site [1]. It just isn't the best way...
Besides that, do you already have python, cairo and pycairo installed?

Cheers,

Magnun Leno

unread,
Jul 8, 2009, 10:33:44 AM7/8/09
to CairoPlot
Rdrigo,

It's about time to make a release with the source code in a tar.gz
format. I haven't done it 'couse I don't have this persmission in
Launchpad.

Kashif, I've downloaded the source code files and zipped them. You
can download it from here: http://files.getdropbox.com/u/365419/CairoPlot.zip

Please contact us if you face any trouble!
Magnun Leno

On 8 jul, 11:02, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> It's possible to download each file on the launchpad site [1]. It just isn't
> the best way...Besides that, do you already have python, cairo and pycairo
> installed?
>
> Cheers,
>
> Rodrigo
>
> [1]http://bazaar.launchpad.net/~alf-rodrigo/cairoplot/trunk/files/head:/...

snake007uk

unread,
Jul 9, 2009, 10:33:53 AM7/9/09
to CairoPlot
Hey Guys,

Thanks for the help. I have been playing with Open Flash charts :)...

I will download the zip file and try the install again.

Just a note, I develop on OSX and once the application is complete it
will be running on a linux box.

Kashif

snake007uk

unread,
Jul 9, 2009, 10:34:19 AM7/9/09
to CairoPlot
I just realised your using dropbox :) its really great :)

Kashif

On Jul 8, 3:33 pm, Magnun Leno <magnun.l...@gmail.com> wrote:

Magnun Leno

unread,
Jul 9, 2009, 10:51:29 AM7/9/09
to cair...@googlegroups.com
Yeah, drop box is really great! But I'm facing some bugs with it. I can't share tar.gz files, they are received as broken files. But still a great sharing tool.

Att,
Magnun Leno

snake007uk

unread,
Jul 9, 2009, 11:42:48 AM7/9/09
to CairoPlot
ok I think i got it installed, however where is the documentation? Is
there any examples I can use?

My main problem is my y_max = 30 million+ so I need to make sure the Y
Axis is correctly setup. I am just looking for a clean bar chart.

Kashif



On Jul 9, 3:51 pm, Magnun Leno <magnun.l...@gmail.com> wrote:
> Yeah, drop box is really great! But I'm facing some bugs with it. I can't
> share tar.gz files, they are received as broken files. But still a great
> sharing tool.
>
> Att,
> Magnun Leno
>
> On Thu, Jul 9, 2009 at 11:34 AM, snake007uk <snake00...@gmail.com> wrote:
>
> > I just realised your using dropbox :) its really great :)
>
> > Kashif
>
> > On Jul 8, 3:33 pm, Magnun Leno <magnun.l...@gmail.com> wrote:
> > > Rdrigo,
>
> > >   It's about time to make a release with the source code in a tar.gz
> > > format. I haven't done it 'couse I don't have this persmission in
> > > Launchpad.
>
> > >   Kashif, I've downloaded the source code files and zipped them. You
> > > can download it from here:
> >http://files.getdropbox.com/u/365419/CairoPlot.zip
>
> > > Please contact us if you face any trouble!
> > > Magnun Leno
>
> > > On 8 jul, 11:02, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
>
> > > > It's possible to download each file on the launchpad site [1]. It just
> > isn't
> > > > the best way...Besides that, do you already have python, cairo and
> > pycairo
> > > > installed?
>
> > > > Cheers,
>
> > > > Rodrigo
>
> > > > [1]
> >http://bazaar.launchpad.net/~alf-rodrigo/cairoplot/trunk/files/head:/.<http://bazaar.launchpad.net/%7Ealf-rodrigo/cairoplot/trunk/files/head:/.>
> > ..

snake007uk

unread,
Jul 9, 2009, 11:50:06 AM7/9/09
to CairoPlot
New Error:

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/cairoplot.py", line 37, in <module>
from Series import Series, Group, Data
ImportError: No module named Series

Magnun Leno

unread,
Jul 9, 2009, 12:21:57 PM7/9/09
to CairoPlot
It seems that the Series module wasn't installed correctly.

Try unzipping the source and running the tests.py file with the
following command:
$ python tests.py

Rodrigo, I'm not an expert in disutils so, could you take a look in
the setup.py? Isn't necessary to inform the Series module??

Thanks,
Magnun Leno

snake007uk

unread,
Jul 9, 2009, 4:53:10 PM7/9/09
to CairoPlot
ok it works if I use the test.py, basically the series.py series.pyc
are noting being transferred as part of the install.

ive done this now and will test again

Kashif

Magnun Leno

unread,
Jul 9, 2009, 5:25:07 PM7/9/09
to CairoPlot
Kashif,

I'm just waiting the response from Rodrigo to fix this error. I've
submitted a bug report (https://bugs.launchpad.net/cairoplot/+bug/
397603) so we won't forget it.

I'll let you as soon as we fix it! Thanks for helping us
discovering this bug.

Att,
Magnun Leno

snake007uk

unread,
Jul 9, 2009, 5:38:48 PM7/9/09
to CairoPlot
ok got something else :)

here is my code:

def test_bar(self, outputResult, searchType):
data = outputResult
cairoplot.BarPlot('bar_test.png', data, 400, 300, border = 20,
grid = True, rounded_corners = True)

def resultShow(self):
cursor = self.db.cursor()

searchType = ["RTXML001", "RTXML002", "RTXML003", "RTXML004",
"RTXML005", "RTXML006", \
"RTXML007", "RTXML008", "RTXML009", "RTXML013",
"RTXML014", "RTXML016", \
"RTXML017", "RTXML018", "RTXML019", "RTXML020",
"RTXML021", "RTXML023", \
"RTXML024", "RTXML025", "RTXML026", "RTXML027",
"RTXML028", "RTXML029", \
"RTXML030", "RTXML031", "RTXML032", "RTXML033",
"RTXML101", "RTXML102", \
"RTXML103", "RTXML206", "RTXML207", "RTXML208",
"RTXML209"]

outputResult = []


for i in searchType:
cursor.execute ("select COUNT(SubCoreTable) FROM
SubCoreTable WHERE subrequestcode=%s;", (i,))
result = cursor.fetchone()
output = int(result[0])
outputResult.append(int(output))

self.test_bar(outputResult, searchType)



Here is the error:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/cherrypy/
_cprequest.py", line 606, in respond
cherrypy.response.body = self.handler()
File "/usr/local/lib/python2.6/dist-packages/cherrypy/
_cpdispatch.py", line 25, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 22, in index
self.resultShow()
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 48, in resultShow
self.test_bar(outputResult, searchType)
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 27, in test_bar
cairoplot.BarPlot('bar_test.png', data, 400, 300, border = 20,
grid = True, rounded_corners = True)
File "/usr/local/lib/python2.6/dist-packages/cairoplot.py", line
909, in __init__
Plot.__init__(self, surface, data, width, height, background,
border, x_labels, y_labels, series_colors)
File "/usr/local/lib/python2.6/dist-packages/cairoplot.py", line
120, in __init__
self.load_series(data, x_labels, y_labels, series_colors)
File "/usr/local/lib/python2.6/dist-packages/cairoplot.py", line
913, in load_series
self.calc_boundaries()
File "/usr/local/lib/python2.6/dist-packages/cairoplot.py", line
931, in calc_boundaries
if not self.bounds[self.main_dir]:
KeyError: None

I have no idea what I am missing, KeyError?

I am sure you will get some more input from me :) specially from the
OSX side of things. I have my own wiki also wiki.unixcraft.com :)

Rodrigo Araújo

unread,
Jul 9, 2009, 5:45:34 PM7/9/09
to cair...@googlegroups.com
Hey,

Please add a "print data" line before calling cairoplot.BarPlot and send us the output :)


Thanks,

Rodrigo

snake007uk

unread,
Jul 9, 2009, 5:58:04 PM7/9/09
to CairoPlot
As requested:

Data = [0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
24, 0, 0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]

[0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]


Traceback (most recent call last):
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 47, in <module>
main()
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 17, in __call__
self.resultShow()
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 43, in resultShow
self.test_bar(outputResult, searchType)
File "/home/kashif/Dropbox/Programming/Python/ChartGateWayStats/
GateWayStatsCairo.py", line 22, in test_bar

snake007uk

unread,
Jul 9, 2009, 6:01:33 PM7/9/09
to CairoPlot
PS i am using a subset of data, because the real table which I will
get data from has 30million rows and so the results could be huge, i
wanted to start with something small like 300 rows.

snake007uk

unread,
Jul 9, 2009, 6:01:54 PM7/9/09
to CairoPlot
is it possible to autoscale the y axis?

Kashif

Rodrigo Araújo

unread,
Jul 9, 2009, 6:04:41 PM7/9/09
to cair...@googlegroups.com
Just commited the fix on setup.py. Revision 40 of the trunk.
I'll test the bar plot code now.

Rodrigo Araújo

unread,
Jul 9, 2009, 6:09:13 PM7/9/09
to cair...@googlegroups.com
Ok, tested your code.
The problem is that the BarPlot class is abstract. It's there just to be inherited by HorizontalBarPlot and VerticalBarPlot.
Fixing that, if you decide to use the horizontal_bar_plot function, your code should be:

data = [0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]
cairoplot.horizontal_bar_plot('bar_test.png', data, 400, 300, border = 20, grid = True, rounded_corners = True)

or, if you use the HorizontalBarPlot class:

data = [0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]
graphic = cairoplot.HorizontalBarPlot('bar_test.png', data, 400, 300, border = 20, grid = True, rounded_corners = True)
graphic.render()
graphic.commit()


Should work then =D

Thanks for the input!

Rodrigo

snake007uk

unread,
Jul 9, 2009, 6:22:12 PM7/9/09
to CairoPlot
Sorry i dont understand, i am a noobie python developer, so I dont
understand why I could not use bar_plot? what is the difference? what
do you mean by abstract?

On Jul 9, 11:09 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> Ok, tested your code.
> The problem is that the BarPlot class is abstract. It's there just to be
> inherited by HorizontalBarPlot and VerticalBarPlot.
> Fixing that, if you decide to use the horizontal_bar_plot function, your
> code should be:
>
> data = [0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
> 0, 0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]
> cairoplot.horizontal_bar_plot('bar_test.png', data, 400, 300, border = 20,
> grid = True, rounded_corners = True)
>
> or, if you use the HorizontalBarPlot class:
>
> data = [0, 0, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
> 0, 0, 0, 0, 0, 0, 196, 1, 2, 0, 0, 0, 0]
> graphic = cairoplot.HorizontalBarPlot('bar_test.png', data, 400, 300, border
> = 20, grid = True, rounded_corners = True)
> graphic.render()
> graphic.commit()
>
> Should work then =D
>
> Thanks for the input!
>
> Rodrigo
>
> On Thu, Jul 9, 2009 at 7:04 PM, Rodrigo Araújo <alf.rodr...@gmail.com>wrote:
>
> > Just commited the fix on setup.py. Revision 40 of the trunk.
> > I'll test the bar plot code now.
>

snake007uk

unread,
Jul 9, 2009, 6:43:03 PM7/9/09
to CairoPlot
Ok I got it working, now just trying to figure out, how to get it to
draw auto y axis values from the largest value.

Also the bar chart should have number under each bar which corresponds
to the series legend.

Kashif
Reply all
Reply to author
Forward
0 new messages