From: Lionel R. <lro...@li...> - 2006-05-02 08:00:58
|
Hi all, some students in our organisation sent me a problem with matplotlib and mod_python, a simple script generates a plot of temp/pressure, all works fine if they run it from the command-line, but if they use it from a apache web server they receive this : ---------------------------------------------------- Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 136, in handler result = util.apply_fs_data(object, req.form, req=req) File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361, in apply_fs_data return object(**args) File "/var/www/syrso_v2/tests/essai.py", line 11, in index AttributeError: 'module' object has no attribute 'use' --------------------------------------------------------- where the line 11 is : matplotlib.use('Agg') just after a import matplotlib! Thanks for any help -- Lionel Roubeyrie - lro...@li... LIMAIR http://www.limair.asso.fr |
From: Charlie M. <cw...@gm...> - 2006-05-02 12:06:52
|
> Hi all, > some students in our organisation sent me a problem with matplotlib and > mod_python, a simple script generates a plot of temp/pressure, all works = fine > if they run it from the command-line, but if they use it from a apache we= b > server they receive this : > ---------------------------------------------------- > Mod_python error: "PythonHandler mod_python.publisher" > > Traceback (most recent call last): > > File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299,= in > HandlerDispatch > result =3D object(req) > > File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 1= 36, > in > handler > result =3D util.apply_fs_data(object, req.form, req=3Dreq) > > File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361, i= n > apply_fs_data > return object(**args) > > File "/var/www/syrso_v2/tests/essai.py", line 11, in index > > AttributeError: 'module' object has no attribute 'use' > --------------------------------------------------------- > > where the line 11 is : > matplotlib.use('Agg') > just after a import matplotlib! Sounds like it is picking up on a file named matplotlib possibly. Try adding "print matplotlib.__file__" after the "import matplotlib" line. Make sure it is the same when running from the command line and mod_python. - Charlie |
From: Lionel R. <lro...@li...> - 2006-05-02 13:00:32
|
hi, here is the output of repr(matplotlib): <module 'matplotlib' from '/usr/lib/python2.3/site-packages/matplotlib/__init__.pyc'> and matplotlib.__version__ version : 0.82 Le Mardi 02 Mai 2006 14:06, Charlie Moad a =E9crit=A0: > Sounds like it is picking up on a file named matplotlib possibly. Try > adding "print matplotlib.__file__" after the "import matplotlib" line. > Make sure it is the same when running from the command line and > mod_python. > > - Charlie =2D-=20 Lionel Roubeyrie - lro...@li... LIMAIR http://www.limair.asso.fr |
From: Charlie M. <cw...@gm...> - 2006-05-02 13:42:04
|
On 5/2/06, Lionel Roubeyrie <lro...@li...> wrote: > hi, > here is the output of repr(matplotlib): > <module 'matplotlib' from > '/usr/lib/python2.3/site-packages/matplotlib/__init__.pyc'> > > and matplotlib.__version__ > version : 0.82 Is this the same under python command-line and mod_python? If you are getting different results, it is most likely because the environment is different in some way. |