473,808 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(sel f.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fna me)
/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:7 0, 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 1981
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(sel f.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fna me)
/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:7 0, 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(sel f.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fna me)
/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:7 0, in __init__:
self.title = re.sub("(.*)\\. py$", "\\1", sys.argv[0])

AttributeErro r: '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(sel f.file_name)
/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
can = pngcanvas.T(fna me)
/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:7 0, in __init__:
self.title = re.sub("(.*)\\. py$", "\\1", sys.argv[0])

AttributeErr or: '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
>>>AttributeErr or: '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
1981
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 Site, yet when I attempt to browse the Default Web Site I get this error: The page cannot be displayed
0
1268
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 product (1.2 - the latest release), by mean of this you can create MountFolder which data is stored in separate ZODB database.
1
1477
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 be displayed because customErrors is set to remoteOnly in web.config. Right now the application consists of a single page that displays the current date and time -- test.aspx. I can browse plain html files in the same directory without any...
5
2529
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 applications. I am testing an upgrade of all of the sites and have converted the main root site...although not necessarily fixed any issues. I move on instead and converted one of the virtual roots that is a seperate
1
1943
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, pietest.py with some mods) Works great. However were I to paste this into the main flow of my program it fails to gen the graph. Simply no output. I do not produce any errors at run time. I am assuming that I have some pathing wrong. Running on...
3
1379
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 HELM), I get unknown errors when I connect to some of the aspx pages, however if I keep surfing around my web site the pages suddenly start working for no apparent reason. Once each page has been displayed at least once that particular page won't...
0
1093
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 change to the remote server. When I tested for the error on the remote server, I got the old error message, not the new one. I assumed the old code was being cached by the server, so I made a change to Web.config on the remote server to force...
3
1902
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 fine on my machine in VS2005 (worked fine in VS2003 as well). I am using a hosting facility. When I upload the pages to the hosting site, I get nothing but:
3
6299
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 Language="VB" AutoEventWireup="false" CodeBehind="HVOA.master.vb" Inherits="HVOAWebsite.HVOA" %> The site will actually be hosted at an external hosting site, specifically GoDaddy.Com. So I moved the files to their site under a new virtual directory...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.