By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,525 Members | 1,667 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,525 IT Pros & Developers. It's quick & easy.

PyChart into web site error

P: n/a
I'm using PyChart like a module for create charts into a little web
site, but when I try to create one, I have this error:

/var/www/html/lgt/draw.py:19, in draw:
can = canvas.init(self.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fname)
/usr/lib/python2.3/site-packages/pychart/pscanvas.py:25, in __init__:
basecanvas.T.__init__(self)
/usr/lib/python2.3/site-packages/pychart/basecanvas.py:70, in __init__:
self.title = re.sub("(.*)\\.py$", "\\1", sys.argv[0])

AttributeError: 'module' object has no attribute 'argv'

Why my script doesn't have sys.argv?

Is there another way to use PyChart into my script?

Thanks,
Michele
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2005-04-12, Michele Petrazzo <mi**************@TOGLIunipex.it> wrote:
I'm using PyChart like a module for create charts into a little web
site, but when I try to create one, I have this error:

/var/www/html/lgt/draw.py:19, in draw:
can = canvas.init(self.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fname)
/usr/lib/python2.3/site-packages/pychart/pscanvas.py:25, in __init__:
basecanvas.T.__init__(self)
/usr/lib/python2.3/site-packages/pychart/basecanvas.py:70, in __init__:
self.title = re.sub("(.*)\\.py$", "\\1", sys.argv[0])

AttributeError: 'module' object has no attribute 'argv'

Why my script doesn't have sys.argv?

Is there another way to use PyChart into my script?

You are probably going to have to give more details.

Is there a file in your html/lgt folder called sys?

How are you serving the pages?
Jul 18 '05 #2

P: n/a
Lee Harr wrote:
On 2005-04-12, Michele Petrazzo <mi**************@TOGLIunipex.it> wrote:
I'm using PyChart like a module for create charts into a little web
site, but when I try to create one, I have this error:

/var/www/html/lgt/draw.py:19, in draw:
can = canvas.init(self.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fname)
/usr/lib/python2.3/site-packages/pychart/pscanvas.py:25, in __init__:
basecanvas.T.__init__(self)
/usr/lib/python2.3/site-packages/pychart/basecanvas.py:70, in __init__:
self.title = re.sub("(.*)\\.py$", "\\1", sys.argv[0])

AttributeError: 'module' object has no attribute 'argv'

Why my script doesn't have sys.argv?

Is there another way to use PyChart into my script?

You are probably going to have to give more details.

Is there a file in your html/lgt folder called sys?
No.
os.listdir('/var/www/html/lgt/') ['engine.py', 'db.py', 'index.spy', 'linetest.py', 'index.html',
'db_mysql.py', 'mysession.spy', 'cds.html', 'templates', 'tmp', 'draw.py']


How are you serving the pages?


Apache 2.0.48, mod_python 3.1.3 and Python 2.3.3
on my mdk 10.0

Thanks,
Michele
Jul 18 '05 #3

P: n/a
On 2005-04-13, Michele Petrazzo <mi**************@TOGLIunipex.it> wrote:
Lee Harr wrote:
On 2005-04-12, Michele Petrazzo <mi**************@TOGLIunipex.it> wrote:
I'm using PyChart like a module for create charts into a little web
site, but when I try to create one, I have this error:

/var/www/html/lgt/draw.py:19, in draw:
can = canvas.init(self.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fname)
/usr/lib/python2.3/site-packages/pychart/pscanvas.py:25, in __init__:
basecanvas.T.__init__(self)
/usr/lib/python2.3/site-packages/pychart/basecanvas.py:70, in __init__:
self.title = re.sub("(.*)\\.py$", "\\1", sys.argv[0])

AttributeError: 'module' object has no attribute 'argv'

Why my script doesn't have sys.argv?

Is there another way to use PyChart into my script?

You are probably going to have to give more details.

Is there a file in your html/lgt folder called sys?


No.
os.listdir('/var/www/html/lgt/') ['engine.py', 'db.py', 'index.spy', 'linetest.py', 'index.html',
'db_mysql.py', 'mysession.spy', 'cds.html', 'templates', 'tmp', 'draw.py']


How are you serving the pages?


Apache 2.0.48, mod_python 3.1.3 and Python 2.3.3
on my mdk 10.0

Have you tried just running the script from the command
line and not through mod_python?

If that works, there may be some security setting in
mod_python that restricts access to certain modules.
You might want to ask on a more mod_python oriented
list....
http://mailman.modpython.org/mailman...nfo/mod_python

Jul 18 '05 #4

P: n/a
>>>AttributeError: 'module' object has no attribute 'argv'

Why my script doesn't have sys.argv?
.... How are you serving the pages?


Apache 2.0.48, mod_python 3.1.3 and Python 2.3.3
on my mdk 10.0


Obviosly when using mod_python there's no sys.argv (and what would it
contain if it existed??).

Now the real question is why PyChart needs sys.argv?

OTOH, maybe you can make a dummy sys module in your script that provides
sys.argv??
BTW, I tested with Apache 2.0.53, mod_python 3.1.4 and Python 2.4 to confirm
there's no sys.argv in the mod_python environment.

--
damjan
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.