pcplantdb@lists.ibiblio.org
Subject: pcplantdb
List archive
- From: Richard Morris <webmaster@pfaf.org>
- To: Permaculture Plant Database <pcplantdb@lists.ibiblio.org>
- Subject: Re: [pcplantdb] python import problem in cgi env.
- Date: Tue, 07 Dec 2004 17:58:59 +0000
Chad Knepp wrote:
Hello Ibiblio staff,Yep I've had similar problems in the past. I guess that we need to code for the cgi version i.e. 1.5.2.
I'm having some inexplicable (to me anyway) problems with python
failing to import certain packages in the cgi environment of the
virtual host permaculture.info (/public/vhost/pyg). I've written a
test python cgi script to demonstrate the problem that I will attach.
I suspect that the problem has something to do with the fact that the
cgi version of python is 1.5.2 and the shell version of python 2.2.3
or something in the config details of apache or nfs.
Anyway, the problem is currently preventing our cgi script from
importing the necessary packages to function. Our cgi script (Eden)
is designed to function both as a cgi script and a command line
interface one. The cli method of Eden is working properly indicating
[to me] that the problem is an aspect of the cgi environment not Eden
itself. The problem demonstration script also includes cgi and cli
versions.
[ATTACHMENT ~/problem.py, application/octet-stream]
Here is some of the sample output from the cli:
sys.version = 2.2.3 (#1, Aug 8 2003, 08:44:02) [GCC 3.2.3 20030502 (Red Hat
Linux 3.2.3-13)]
sys.path = ['.', '/public/vhost/pyg/cgi-bin', '/usr/lib/python2.2',
'/usr/lib/python2.2/plat-linux2', '/usr/lib/python2.2/lib-dynload',
'/usr/lib/python2.2/site-packages']
imported cgi, cgitb, Eden.Session
From the cgi:
sys.version = 1.5.2 (#1, Mar 13 2003, 18:24:53) [GCC 2.96 20000731 (Red Hat
Linux 7.2 2
sys.path = ['/public/vhost/pyg/cgi-bin', '/usr/lib/python1.5/',
'/usr/lib/python1.5/ plat-linux-i686', '/usr/lib/python1.5/lib-tk',
'/usr/lib/python1.5/lib-dynload', '/usr/lib/ python1.5/site-packages']
imported cgi
import cgitb raised an ImportError: No module named cgitb
import Eden.Session raised a SyntaxError: invalid syntax
You can execute the cli script at /public/vhost/pyg/cgi-bin/problem.py
and access the cgi version at
<http://permaculture.info/cgi-bin/problem.py
Thanks for your time,
Chad
Could possibly hassle ibiblio to use a more recient version.
Is there some way to specify which version of python to use with the cgi.
I'd suggest a bug report to ibiblio support.
Rich
--
Plants for a Future: 7000 useful plants
Web: http://www.pfaf.org/ same as http://www.comp.leeds.ac.uk/pfaf/
Post: 1 Lerryn View, Lerryn, Lostwithiel, Cornwall, PL22 0QJ
Tel: 01208 872 963 / 0845 458 4719
Email: webmaster@pfaf.org
PFAF electronic mailing list http://groups.yahoo.com/group/pfaf
-
[pcplantdb] python import problem in cgi env.,
Chad Knepp, 12/05/2004
-
Re: [pcplantdb] python import problem in cgi env.,
Richard Morris, 12/07/2004
- Re: [pcplantdb] python import problem in cgi env., Chad Knepp, 12/07/2004
-
Re: [pcplantdb] python import problem in cgi env.,
Richard Morris, 12/07/2004
Archive powered by MHonArc 2.6.24.