Error importing modules with mod_python

Aaron Scott aaron.hildebrandt at
Mon Jul 21 19:30:38 CEST 2008

I've installed mod_python, and everything seems to be working, but it
fails when I try to import another file into the file that's actually
producing the output. I have these lines at the top of

from mod_python import apache
from storylab import *

... and in the directory where resides (/htdocs/python/), I
have a directory called "storylab". Inside that directory is When I try to execute /htdocs/python/, I get the
following error:


ProcessId:      828
Interpreter:    'localhost'
ServerName:     'localhost'
DocumentRoot:   'C:/htdocs'
URI:            '/python/'
Location:       None
Directory:      'C:/htdocs/python/'
Filename:       'C:/htdocs/python/'
PathInfo:       ''
Phase:          'PythonHandler'
Handler:        'index'

Traceback (most recent call last):

  File "C:\Python25\lib\site-packages\mod_python\", line
1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "C:\Python25\lib\site-packages\mod_python\", line
1202, in _process_target
    module = import_module(module_name, path=path)

  File "C:\Python25\lib\site-packages\mod_python\", line
296, in import_module
    log, import_path)

  File "C:\Python25\lib\site-packages\mod_python\", line
680, in import_module
    execfile(file, module.__dict__)

  File "C:\htdocs\python\", line 2, in <module>
    from storylab import *

ImportError: No module named storylab


What am I doing wrong? Any insight would be greatly appreciated.


More information about the Python-list mailing list