[mod_python] Import Local Name Error, need help!

Mohamed Sordo neomoha at gmail.com
Mon May 8 15:43:43 EDT 2006

Hi everybody,
I've some problems with my mod_python.
I'm trying to execute server_side.py via mod_python.
I have a mod_python_my_files.conf in /etc/apache2/conf.d/

It seems like that:

<IfModule mod_alias.c>
    Alias /my_server /home/neomoha/PFC/src/server_side.py
<DirectoryMatch /home/neomoha/PFC/src/ >

# mod_python 3.X
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On

    Options +FollowSymLinks

    Order allow,deny
    Allow from all

NOTE: server-side.py is rwx for everybody

When a execute a python script that uses my localhost connection with
mod_python , I have this output:

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in
    result = object(req)

  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 98,
in handler

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 457, in
    module = imp.load_module(mname, f, p, d)

  File "/home/neomoha/PFC/src/server_side.py", line 22, in ?
    from myfile import MyFile

ImportError: cannot import name MyFile

NOTE: myfile.py is in /home/neomoha/PFC/src/ directory.
And I'm using Apache/2.0.55 (Debian) mod_python/3.1.3 Python/2.3.5 Server at
localhost Port 80

Thanks for any answer,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060508/41d4f17f/attachment.html

More information about the Mod_python mailing list