Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Can't Find Module

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


victorsubervi at gmail

Nov 7, 2009, 8:59 AM

Post #1 of 2 (53 views)
Permalink
Can't Find Module

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


rhodri at wildebst

Nov 9, 2009, 3:01 PM

Post #2 of 2 (37 views)
Permalink
Re: Can't Find Module [In reply to]

On Sat, 07 Nov 2009 16:59:29 -0000, Victor Subervi
<victorsubervi[at]gmail.com> wrote:

> ImportError: No module named template
[snip]
>
> I can import this just fine from the python command prompt. So, what
> gives?

Is template.py in your current directory when you run the script from the
command line?

--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.