[mod_python] No module named _md5

Graham Dumpleton grahamd at dscpl.com.au
Wed Oct 11 05:48:22 EDT 2006


Add at the very start of the module:

   from mod_python import apache
   apache.log_error('path=%s' % sys.path)

Look in the Apache error log file to see what sys.path is. Look through
those directories listed to see if one includes _md5module.so  or  
_m5.so.
If it is, make sure permissions have it as readable to others as Apache
will run as special user normally and may not be able to read it if  
it is
something else.

Graham


On 11/10/2006, at 6:54 PM, Andrew Wilkinson wrote:

> I have reduced my code to the following test case:
>
> from hashlib import md5
>
> def handler(req):
>     req.content_type = "text/plain"
>     req.write(md5("hello").hexdigest())
>
> which produces the following traceback:
>
> Mod_python error: "PythonHandler handler"
> Traceback (most recent call last):
>   File "/usr/lib/python2.5/site-packages/mod_python/apache.py",  
> line 287, in HandlerDispatch
>     log=debug)
>   File "/usr/lib/python2.5/site-packages/mod_python/apache.py",  
> line 464, in import_module
>     module = imp.load_module(mname, f, p, d)
>   File "/var/www/indiegigs/src/handler.py", line 3, in
>     from hashlib import md5
>   File "/usr/lib64/python2.5/hashlib.py", line 104, in
>     md5 = __get_builtin_constructor('md5')
>   File "/usr/lib64/python2.5/hashlib.py", line 31, in  
> __get_builtin_constructor
>     import _md5
> ImportError: No module named _md5
>
>
> Regards,
> Andrew
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python


More information about the Mod_python mailing list