473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PyChart into web site error

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
4 1964
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
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
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
>>>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Caruthers | last post by:
HELP! This problem is driving me crazy. All other web sites that are being served out through this server are working, including sites and virtual directories that are under the Default Web...
0
by: krzychu | last post by:
Hallo, I have an existing plone site called "info", I've added some scripts to it. I would like to have that plone site into a separate ZODB database(separate ..fs file). There is a MountFolder...
1
by: Tim Wood | last post by:
I'm having trouble with setup of an asp.net application on Windows 2003. When I attempt to start the app I get "Server Error in '/MyApp' application. The message also says that error details cannot...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
1
by: john.mcginnis | last post by:
I am attempting to generate some graphics prior to display on a webpage. I have GhostScript 8.x loaded. And I can from the code below generate the desired graphic. (it's right out of the /demos,...
3
by: Timbo | last post by:
This is a really weird one and very odd. I have written a web site using VS2005 and .Net 2.0, all works very well when running it locally. However when I publish it to my web server (hosted by...
0
by: David Veeneman | last post by:
Here's a problem I haven't run into before. I'm testing my site on a remote server. This morning, I changed an error message in an email, tested it locally, then used 'Copy Web Site...' to copy the...
3
by: =?Utf-8?B?RWRC?= | last post by:
I am having a real problem with this. I am much more a Windows guy then a Web guy, so that doesn't help. I have an ASP app I developed in VS2003/VB. I then converted it to VS2005. It works...
3
by: =?Utf-8?B?SGVyYg==?= | last post by:
I've developed an ASP.NET website that runs fine on my local WinXP IIS and on my server's IIS, both are IIS6.0 The site uses a master page that has the following declaration: <%@ Master...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.