[mod_python] ImportError

Bert Hughes bert at tela.com
Sat Nov 1 15:24:23 EST 2003



Apache2 conf is:

LoadModule python_module modules/mod_python.so

<Directory /usr/local/apache2/htdocs/python>

SetHandler python-program

PythonHandler mod_python.publisher

</Directory>



hello.py is

>>>

def say(what="Nothing"):
    return "I am saying %s" % what

if __name__ == '__main__':
    print say('At the commandline!')

>>>>>



and it is in /usr/local/apache2/htdocs/python.

So the url is"     http:/192.168.1.1/python/hello.py/say

Thanks

Bert

----- Original Message ----- 
From: "Gregory (Grisha) Trubetskoy" <grisha at modpython.org>
To: "Bert Hughes" <bert at tela.com>
Cc: <mod_python at modpython.org>
Sent: Saturday, November 01, 2003 1:41 PM
Subject: Re: [mod_python] ImportError


>
> What is the URL you are accessing, what is the relevant Apache config, and
> what's in hello.py?
>
> Grisha
>
> On Sat, 1 Nov 2003, Bert Hughes wrote:
>
> > Hello-
> >
> > I've been attempting to upgrade my Apache/mod_python setup w/o success.
I
> > run the "hello.py/say"
> > example and the following message appears in apache's 'error_log':
> >
> > ....
> >
> > File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 493,
in
> > import_module
> >    f, p, d = imp.find_module(parts[i],path)
> > [Fri Oct 32 ...] [error] [client 192.168.1.3] PythonHandler
> > mod_python.publisher: ImportError: No module named index
> >
> >
> > Currently I'm trying
> >
> > Apache 2.047
> > Python 2.3.2
> > mod_python 3.1.2b
> >
> > but I've gotten same result with combintaions of mod_python 3.0.3,
python
> > 2.2.
> >
> > "hello.py" runs just fine with out-of-redhat box apache/mod_python, and
> > there's no apparent module named "index" there.
> >
> > Bert Hughes
> >
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
>
>




More information about the Mod_python mailing list