Can't Find Module
Victor Subervi
victorsubervi at gmail.com
Sat Nov 7 11:59:29 EST 2009
Hi;
I'm getting this error:
Mod_python error: "PythonHandler mod_python.publisher"
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299,
in HandlerDispatch
result = object(req)
File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line
204, in handler
module = page_cache[req]
File "/usr/lib64/python2.4/site-packages/mod_python/cache.py", line 82, in
__getitem__
return self._checkitem(name)[2]
File "/usr/lib64/python2.4/site-packages/mod_python/cache.py", line 124,
in _checkitem
value = self.build(key, name, opened, entry)
File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line
77, in build
return ModuleCache.build(self, key, req, opened, entry)
File "/usr/lib64/python2.4/site-packages/mod_python/cache.py", line 371,
in build
exec opened in module.__dict__
File "/var/www/html/angrynates.com/global_solutions/index.py", line 8, in
?
from template import template
ImportError: No module named template
Here's the code:
#!/usr/bin/python
import string
import cgitb; cgitb.enable()
import cgi
import sys,os
sys.path.append(os.getcwd())
from template import template
ourFile = string.split(__file__, "/")
page = ourFile[len(ourFile) - 1][:-3]
form = cgi.FieldStorage()
w = form.getfirst('w', '1024')
print page
template(page, w)
I can import this just fine from the python command prompt. So, what gives?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091107/cd13a4d0/attachment.html>
More information about the Python-list
mailing list