[Tutor] pychart and debian
dyoo at hkn.eecs.berkeley.edu
Mon Sep 19 04:48:25 CEST 2005
> ok, got the package installed, but it seems to not be working, or the
> examples are messed up.
> here is the source
> from pychart import *
> data = [["Jan", 10], ["Feb", 22], ["Mar", 30]]
> ar = area.T(x_coord = category_coord.T(data, 0),
> y_range = (0, None),
> x_axis = axis.X(label="Month"),
> y_axis = axis.Y(label="Value"))
> ar.add_plot(bar_plot.T(data = data, label = "Something"))
> and here is what i get when i run it.
> from: can't read /var/mail/pychart
Ah! You're running into an issue with your Unix environment, not Python.
Unix doesn't care about file names: without any hints, it'll think that
your program is a mere shell script. The error message above means that
'/bin/sh' is trying to interpret your program. That is, it's trying to
run the Unix 'from' command!
And the subsequent error messages are pretty much '/bin/sh' error
To avoid this problem, try:
$ python categbar.py
Alternatively, make sure the first line in your Python program contains
the "magic" line:
to tell the Unix (or Linux) kernel that the program you're running is
meant to be run through Python.
More information about the Tutor