Skip to Content.
Sympa Menu

pcplantdb - [pcplantdb] python import problem in cgi env.

pcplantdb@lists.ibiblio.org

Subject: pcplantdb

List archive

Chronological Thread  
  • From: Chad Knepp <pyg@galatea.org>
  • To: help@ibiblio.org
  • Cc: pcplantdb@lists.ibiblio.org
  • Subject: [pcplantdb] python import problem in cgi env.
  • Date: Sun, 05 Dec 2004 18:27:31 -0600

Hello Ibiblio staff,

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

--
Chad Knepp
Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;




Archive powered by MHonArc 2.6.24.

Top of Page