CGI and logging module

Peter Otten __peter__ at web.de
Fri Nov 19 04:47:45 EST 2004


Peter Mott wrote:

> As I said I am using Python on FreeBSD:
> 
> Python 2.3.4 (#2, Nov 14 2004, 18:06:48)
> [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import logging
>>>>
> 
> and I imported loggng successfully. When I modify my script to the
> following:
> ===============
> #!/usr/local/bin/python
> 
> try:
>    import logging
> except Exception, e:
>    print "Content-type: text/html\n"
>    print "<html><head><title></title></head><body><p>" + str(e) +"<p>"""
> else:
>    print "Content-type: text/html\n"
>    print
> "<html><head><title></title></head><body><h1>OK</h1></body></html>"""
> 
> ==============
> It reports the error which is " No module named logging " .  Something is
> wrong here. Does anyone have any ideas?

Is 2.3.4 the only python interpreter on your system? You could use
sys.version to verify that you are not accidentally using an older (pre
2.3) version that does not offer that package.

Peter




More information about the Python-list mailing list