Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 July 5, 2007 19:59:50

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


I have python 2.5.1, django report errors:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
line 193, in Dispatch
result = object(req)

File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
modpython.py", line 177, in handler
return ModPythonHandler()(req)

File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
modpython.py", line 145, in __call__
self.load_middleware()

File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
base.py", line 31, in load_middleware
raise exceptions.ImproperlyConfigured, 'Error importing middleware
%s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware
django.middleware.common: "No module named _md5"

When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 July 5, 2007 20:13:56

nick f.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


It' seems that the md5 is not a middleware, but you have write it in the
setting.py file's middleware setting part.

----- Original Message -----
From: "e-gor" <>
To: "Django users" <django-users@googlegroups.com>
Sent: Friday, July 06, 2007 2:59 AM
Subject: No module named _md5


>
>
> I have python 2.5.1, django report errors:
>
> Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
> File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> line 193, in Dispatch
> result = object(req)
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 177, in handler
> return ModPythonHandler()(req)
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 145, in __call__
> self.load_middleware()
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 31, in load_middleware
> raise exceptions.ImproperlyConfigured, 'Error importing middleware
> %s: "%s"' % (mw_module, e)
>
> ImproperlyConfigured: Error importing middleware
> django.middleware.common: "No module named _md5"
>
> When i write import md5 from python command prompt i have no errors.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 July 5, 2007 20:46:36

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


so what should i do? :) i'm newby :) there are no md5 module
requirements in the setting.py

On 5 июл, 22:13, "nick feng" <> wrote:
> It' seems that the md5 is not a middleware, but you have write it in the
> setting.py file's middleware setting part.
>
> ----- Original Message -----
> From: "e-gor" <>
> To: "Django users" <django-users@googlegroups.com>
> Sent: Friday, July 06, 2007 2:59 AM
> Subject: No module named _md5
>
> > I have python 2.5.1, django report errors:
>
> > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > Traceback (most recent call last):
>
> > File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > line 193, in Dispatch
> > result = object(req)
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > modpython.py", line 177, in handler
> > return ModPythonHandler()(req)
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > modpython.py", line 145, in __call__
> > self.load_middleware()
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > base.py", line 31, in load_middleware
> > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > %s: "%s"' % (mw_module, e)
>
> > ImproperlyConfigured: Error importing middleware
> > django.middleware.common: "No module named _md5"
>
> > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#4 July 5, 2007 21:58:48

Horst G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


e-gor wrote:
> so what should i do? :) i'm newby :) there are no md5 module
> requirements in the setting.py
>
> On 5 июл, 22:13, "nick feng" <> wrote:
>> It' seems that the md5 is not a middleware, but you have write it in the
>> setting.py file's middleware setting part.
>>
>> ----- Original Message -----
>> From: "e-gor" <>
>> To: "Django users" <django-users@googlegroups.com>
>> Sent: Friday, July 06, 2007 2:59 AM
>> Subject: No module named _md5
>>
>>> I have python 2.5.1, django report errors:
>>> Mod_python error: "PythonHandler django.core.handlers.modpython"
>>> Traceback (most recent call last):
>>> File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
>>> line 193, in Dispatch
>>> result = object(req)
>>> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
>>> modpython.py", line 177, in handler
>>> return ModPythonHandler()(req)
>>> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
>>> modpython.py", line 145, in __call__
>>> self.load_middleware()
>>> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
>>> base.py", line 31, in load_middleware
>>> raise exceptions.ImproperlyConfigured, 'Error importing middleware
>>> %s: "%s"' % (mw_module, e)
>>> ImproperlyConfigured: Error importing middleware
>>> django.middleware.common: "No module named _md5"
>>> When i write import md5 from python command prompt i have no errors.
>

Another idea: How have you installed Python? If you were using some kind
of package manager, check if there are some additional crypto-related
packages in the same repository :-)

- Horst

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#5 July 6, 2007 14:32:24

R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


i'm not great at this, but a shot in the dark - turn off mod_php

On Jul 5, 2:59 pm, e-gor <> wrote:
> I have python 2.5.1, django report errors:
>
> Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
> File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> line 193, in Dispatch
> result = object(req)
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 177, in handler
> return ModPythonHandler()(req)
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 145, in __call__
> self.load_middleware()
>
> File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 31, in load_middleware
> raise exceptions.ImproperlyConfigured, 'Error importing middleware
> %s: "%s"' % (mw_module, e)
>
> ImproperlyConfigured: Error importing middleware
> django.middleware.common: "No module named _md5"
>
> When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#6 July 7, 2007 09:25:32

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


Switching off mod_php doesn't help.

when i import module md5 from command prompt there are no errors:

# python
Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
[GCC 3.4.6 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import md5
>>> import blahblah
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named blahblah
>>>


On Jul 6, 4:26 pm, Roboto <> wrote:
> i'm not great at this, but a shot in the dark - turn off mod_php
>
> On Jul 5, 2:59 pm, e-gor <> wrote:
>
> > I have python 2.5.1, django report errors:
>
> > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > Traceback (most recent call last):
>
> > File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > line 193, in Dispatch
> > result = object(req)
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > modpython.py", line 177, in handler
> > return ModPythonHandler()(req)
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > modpython.py", line 145, in __call__
> > self.load_middleware()
>
> > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > base.py", line 31, in load_middleware
> > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > %s: "%s"' % (mw_module, e)
>
> > ImproperlyConfigured: Error importing middleware
> > django.middleware.common: "No module named _md5"
>
> > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#7 July 7, 2007 12:40:38

Graham D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


On Jul 7, 6:25 pm, e-gor <> wrote:
> Switching off mod_php doesn't help.
>
> when i import module md5 from command prompt there are no errors:
>
> # python
> Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> [GCC 3.4.6 20060305] on freebsd6
> Type "help", "copyright", "credits" or "license" for more information.>>>
> import md5
> >>> import blahblah
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named blahblah

Can you import 'hashlib' on the command line:

import hashlib

In Python 2.5 how the hash library modules is done was changed. This
has caused issues before:http://www.modpython.org/pipermail/mod_python/2007-April/023508.htmlhttp://www.modpython.org/pipermail/mod_python/2007-April/023512.htmlA suitable answer wasn't found as it fixed itself when person
recompiled Apache.

My suspicion is that in recompiling Apache, Apache was then using the
same shared library version of something (probably SSL libraries) as
one of the Python hash modules was using. Previous to that it was
using different versions and that caused a problem when loading one of
the Python modules, thus resulting in it falling back to trying to
load _md5 when it shouldn't have. Loading _md5 would fail as in Python
2.5 it doesn't necessarily exist as hashlib modules replace it from
memory.

Note, in recompiling Apache it may be important to ensure that it
finds and uses system SSL libraries, otherwise it will use one from
its own source code and that is where the clash may arise because
Python will use the system one instead.

Graham

> On Jul 6, 4:26 pm, Roboto <> wrote:
>
> > i'm not great at this, but a shot in the dark - turn off mod_php
>
> > On Jul 5, 2:59 pm, e-gor <> wrote:
>
> > > I have python 2.5.1, django report errors:
>
> > >Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > > Traceback (most recent call last):
>
> > > File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > > line 193, in Dispatch
> > > result = object(req)
>
> > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > modpython.py", line 177, in handler
> > > return ModPythonHandler()(req)
>
> > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > modpython.py", line 145, in __call__
> > > self.load_middleware()
>
> > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > base.py", line 31, in load_middleware
> > > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > > %s: "%s"' % (mw_module, e)
>
> > > ImproperlyConfigured: Error importing middleware
> > > django.middleware.common: "No module named _md5"
>
> > > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#8 July 10, 2007 06:36:55

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


Rebuilding apache doesn't help

# python
Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
[GCC 3.4.6 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import md5
>>> import _md5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _md5
>>> import hashlib
>>> import _hashlib


so i have error when importing _md5 and have no erroro when importing
md5. What it mean? :)

On Jul 7, 2:40 pm, Graham Dumpleton <>
wrote:
> On Jul 7, 6:25 pm, e-gor <> wrote:
>
> > Switching off mod_php doesn't help.
>
> > when i import module md5 from command prompt there are no errors:
>
> > # python
> > Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> > [GCC 3.4.6 20060305] on freebsd6
> > Type "help", "copyright", "credits" or "license" for more information.>>>
> > import md5
> > >>> import blahblah
>
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > ImportError: No module named blahblah
>
> Can you import 'hashlib' on the command line:
>
> import hashlib
>
> In Python 2.5 how the hash library modules is done was changed. This
> has caused issues before:
>
>http://www.modpython.org/pipermail/mod_python/2007-April/023508.html>http://www.modpython.org/pipermail/mod_python/2007-April/023512.html>
> A suitable answer wasn't found as it fixed itself when person
> recompiled Apache.
>
> My suspicion is that in recompiling Apache, Apache was then using the
> same shared library version of something (probably SSL libraries) as
> one of the Python hash modules was using. Previous to that it was
> using different versions and that caused a problem when loading one of
> the Python modules, thus resulting in it falling back to trying to
> load _md5 when it shouldn't have. Loading _md5 would fail as in Python
> 2.5 it doesn't necessarily exist as hashlib modules replace it from
> memory.
>
> Note, in recompiling Apache it may be important to ensure that it
> finds and uses system SSL libraries, otherwise it will use one from
> its own source code and that is where the clash may arise because
> Python will use the system one instead.
>
> Graham
>
> > On Jul 6, 4:26 pm, Roboto <> wrote:
>
> > > i'm not great at this, but a shot in the dark - turn off mod_php
>
> > > On Jul 5, 2:59 pm, e-gor <> wrote:
>
> > > > I have python 2.5.1, django report errors:
>
> > > >Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > > > Traceback (most recent call last):
>
> > > > File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > > > line 193, in Dispatch
> > > > result = object(req)
>
> > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > modpython.py", line 177, in handler
> > > > return ModPythonHandler()(req)
>
> > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > modpython.py", line 145, in __call__
> > > > self.load_middleware()
>
> > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > base.py", line 31, in load_middleware
> > > > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > > > %s: "%s"' % (mw_module, e)
>
> > > > ImproperlyConfigured: Error importing middleware
> > > > django.middleware.common: "No module named _md5"
>
> > > > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#9 July 10, 2007 12:02:56

Graham D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


On Jul 10, 3:36 pm, e-gor <> wrote:
> Rebuilding apache doesn't help
>
> # python
> Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> [GCC 3.4.6 20060305] on freebsd6
> Type "help", "copyright", "credits" or "license" for more information.>>>
> import md5
> >>> import _md5
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named _md5
>
> >>> import hashlib
> >>> import _hashlib
>
> so i have error when importing _md5 and have no erroro when importing
> md5. What it mean? :)

Run:

ldd _hashlib.so

You'll need to go find _hashlib.so in the Python library directory.

As I said, what is possibly happening is that _hashlib.so has a
dependency on some shared library, probably the SSL libraries, and
this clashes with either the version used by Apache or which is
compiled into Apache.

Thus, also do:

ldd httpd

Ie., look at shared library dependencies for Apache executable.

If both show dependencies on same library but different versions you
will have a problem.

If no SSL library dependency for httpd, then it is using compiled in
version of SSL and you will have a problem.

In either case, you will need to rebuild Apache so that it uses the
same SSL shared library as Python _hashlib.so and as a dynamic library
dependency, not compiled in.

To absolutely confirm it is _hashlib.so, you can also write a basic
mod_python handler which does a direct import of _hashlib. If that
fails, then that module is definitely the cause.

Now if this thinking is correct, the reason that _md5 shows as the
problem, is that if Python can't import _hashlib in the hashlib
module, it will catch the exception and try and import _md5 instead,
but that doesn't exist in Python 2.5. Importing md5 works, because it
actually imports hashlib these days and not _md5 directly.

Graham

> On Jul 7, 2:40 pm, Graham Dumpleton <>
> wrote:
>
> > On Jul 7, 6:25 pm, e-gor <> wrote:
>
> > > Switching off mod_php doesn't help.
>
> > > when i import module md5 from command prompt there are no errors:
>
> > > # python
> > > Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> > > [GCC 3.4.6 20060305] on freebsd6
> > > Type "help", "copyright", "credits" or "license" for more information.>>>
> > > import md5
> > > >>> import blahblah
>
> > > Traceback (most recent call last):
> > > File "<stdin>", line 1, in <module>
> > > ImportError: No module named blahblah
>
> > Can you import 'hashlib' on the command line:
>
> > import hashlib
>
> > In Python 2.5 how the hash library modules is done was changed. This
> > has caused issues before:
>
> >http://www.modpython.org/pipermail/mod_python/2007-April/023508.html> >http://www.modpython.org/pipermail/mod_python/2007-April/023512.html>
> > A suitable answer wasn't found as it fixed itself when person
> > recompiled Apache.
>
> > My suspicion is that in recompiling Apache, Apache was then using the
> > same shared library version of something (probably SSL libraries) as
> > one of the Python hash modules was using. Previous to that it was
> > using different versions and that caused a problem when loading one of
> > the Python modules, thus resulting in it falling back to trying to
> > load _md5 when it shouldn't have. Loading _md5 would fail as in Python
> > 2.5 it doesn't necessarily exist as hashlib modules replace it from
> > memory.
>
> > Note, in recompiling Apache it may be important to ensure that it
> > finds and uses system SSL libraries, otherwise it will use one from
> > its own source code and that is where the clash may arise because
> > Python will use the system one instead.
>
> > Graham
>
> > > On Jul 6, 4:26 pm, Roboto <> wrote:
>
> > > > i'm not great at this, but a shot in the dark - turn off mod_php
>
> > > > On Jul 5, 2:59 pm, e-gor <> wrote:
>
> > > > > I have python 2.5.1, django report errors:
>
> > > > >Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > > > > Traceback (most recent call last):
>
> > > > > File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > > > > line 193, in Dispatch
> > > > > result = object(req)
>
> > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > modpython.py", line 177, in handler
> > > > > return ModPythonHandler()(req)
>
> > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > modpython.py", line 145, in __call__
> > > > > self.load_middleware()
>
> > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > base.py", line 31, in load_middleware
> > > > > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > > > > %s: "%s"' % (mw_module, e)
>
> > > > > ImproperlyConfigured: Error importing middleware
> > > > > django.middleware.common: "No module named _md5"
>
> > > > > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#10 July 12, 2007 19:55:15

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

No module named _md5


# ldd _hashlib.so
_hashlib.so:
ldd: _hashlib.so: Shared object "_hashlib.so" not found, required by
"ldd"
_hashlib.so: exit status 1

So it's mean that _hashlib.so can't be loaded because it can't find
itself? It's strange

file _hashlib.so found at /usr/local/lib/python2.5/lib-dynload


with httpd all ok:

# ldd httpd
httpd:
libcrypt.so.3 => /lib/libcrypt.so.3 (0x280fe000)
libssl.so.4 => /usr/lib/libssl.so.4 (0x28116000)
libcrypto.so.4 => /lib/libcrypto.so.4 (0x28144000)
libexpat.so.4 => /usr/lib/libexpat.so.4 (0x28237000)
libc.so.6 => /lib/libc.so.6 (0x28255000)


On Jul 10, 2:02 pm, Graham Dumpleton <>
wrote:
> On Jul 10, 3:36 pm, e-gor <> wrote:
>
>
>
> > Rebuilding apache doesn't help
>
> > # python
> > Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> > [GCC 3.4.6 20060305] on freebsd6
> > Type "help", "copyright", "credits" or "license" for more information.>>>
> > import md5
> > >>> import _md5
>
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > ImportError: No module named _md5
>
> > >>> import hashlib
> > >>> import _hashlib
>
> > so i have error when importing _md5 and have no erroro when importing
> > md5. What it mean? :)
>
> Run:
>
> ldd _hashlib.so
>
> You'll need to go find _hashlib.so in the Python library directory.
>
> As I said, what is possibly happening is that _hashlib.so has a
> dependency on some shared library, probably the SSL libraries, and
> this clashes with either the version used by Apache or which is
> compiled into Apache.
>
> Thus, also do:
>
> ldd httpd
>
> Ie., look at shared library dependencies for Apache executable.
>
> If both show dependencies on same library but different versions you
> will have a problem.
>
> If no SSL library dependency for httpd, then it is using compiled in
> version of SSL and you will have a problem.
>
> In either case, you will need to rebuild Apache so that it uses the
> same SSL shared library as Python _hashlib.so and as a dynamic library
> dependency, not compiled in.
>
> To absolutely confirm it is _hashlib.so, you can also write a basic
> mod_python handler which does a direct import of _hashlib. If that
> fails, then that module is definitely the cause.
>
> Now if this thinking is correct, the reason that _md5 shows as the
> problem, is that if Python can't import _hashlib in the hashlib
> module, it will catch the exception and try and import _md5 instead,
> but that doesn't exist in Python 2.5. Importing md5 works, because it
> actually imports hashlib these days and not _md5 directly.
>
> Graham
>
> > On Jul 7, 2:40 pm, Graham Dumpleton <>
> > wrote:
>
> > > On Jul 7, 6:25 pm, e-gor <> wrote:
>
> > > > Switching off mod_php doesn't help.
>
> > > > when i import module md5 from command prompt there are no errors:
>
> > > > # python
> > > > Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> > > > [GCC 3.4.6 20060305] on freebsd6
> > > > Type "help", "copyright", "credits" or "license" for more
> > > > information.>>> import md5
> > > > >>> import blahblah
>
> > > > Traceback (most recent call last):
> > > > File "<stdin>", line 1, in <module>
> > > > ImportError: No module named blahblah
>
> > > Can you import 'hashlib' on the command line:
>
> > > import hashlib
>
> > > In Python 2.5 how the hash library modules is done was changed. This
> > > has caused issues before:
>
> > >http://www.modpython.org/pipermail/mod_python/2007-April/023508.html> > >http://www.modpython.org/pipermail/mod_python/2007-April/023512.html>
> > > A suitable answer wasn't found as it fixed itself when person
> > > recompiled Apache.
>
> > > My suspicion is that in recompiling Apache, Apache was then using the
> > > same shared library version of something (probably SSL libraries) as
> > > one of the Python hash modules was using. Previous to that it was
> > > using different versions and that caused a problem when loading one of
> > > the Python modules, thus resulting in it falling back to trying to
> > > load _md5 when it shouldn't have. Loading _md5 would fail as in Python
> > > 2.5 it doesn't necessarily exist as hashlib modules replace it from
> > > memory.
>
> > > Note, in recompiling Apache it may be important to ensure that it
> > > finds and uses system SSL libraries, otherwise it will use one from
> > > its own source code and that is where the clash may arise because
> > > Python will use the system one instead.
>
> > > Graham
>
> > > > On Jul 6, 4:26 pm, Roboto <> wrote:
>
> > > > > i'm not great at this, but a shot in the dark - turn off mod_php
>
> > > > > On Jul 5, 2:59 pm, e-gor <> wrote:
>
> > > > > > I have python 2.5.1, django report errors:
>
> > > > > >Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > > > > > Traceback (most recent call last):
>
> > > > > > File
> > > > > > "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > > > > > line 193, in Dispatch
> > > > > > result = object(req)
>
> > > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > > modpython.py", line 177, in handler
> > > > > > return ModPythonHandler()(req)
>
> > > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > > modpython.py", line 145, in __call__
> > > > > > self.load_middleware()
>
> > > > > > File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > > > base.py", line 31, in load_middleware
> > > > > > raise exceptions.ImproperlyConfigured, 'Error importing
> > > > > > middleware
> > > > > > %s: "%s"' % (mw_module, e)
>
> > > > > > ImproperlyConfigured: Error importing middleware
> > > > > > django.middleware.common: "No module named _md5"
>
> > > > > > When i write import md5 from python command prompt i have no errors.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

Board footer

Moderator control

Enjoy the 19th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support