Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: ImportError: No module named _md5 - please help

Reply
Thread Tools

Re: ImportError: No module named _md5 - please help

 
 
Falcolas
Guest
Posts: n/a
 
      10-29-2009
On Oct 29, 9:13*am, user7304 <wadie...@gmail.com> wrote:
> Hi,
>
> I am trying to run a python script and got this error.
>
> >>import _md5
> >>ImportError: No module named _md5

>
> Googling the problem suggested that I install the 'py25-hashlib'.
>
> the following does not work for me 'sudo port install py25-hashlib' ,
> trying to install MacPorts raised many problems.
>
> My question is: any idea on how to install it using yum?
> I am running python 2.6.2 on a centos machine.
>
> Many thanks for your help.


Try using hashlib.md5. From the docs:

>>> import hashlib
>>> m = hashlib.md5()
>>> m.update("Nobody inspects")
>>> m.update(" the spammish repetition")
>>> m.digest()

'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d \xf0\xff\xe9'

http://www.python.org/doc/2.5.2/lib/module-hashlib.html

Garrick
 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      10-29-2009
On 2009-10-29 11:39 AM, wadi wadi wrote:
> Hi Garrick,
>
> My python script depends on another framework that is implemented in python.
> The error is originating from the framework code note my script and I
> cannot change the framework.
>
> Also, it works on other machines. So my guess is that I have no choice I
> need to install the 'py25-hashlib' on my current box.
> Any idea?


py25-hashlib is the name of a MacPorts package. That's for Macs, not Centos.

hashlib is part of the standard library. You have a broken Python installation.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImportError: No module named _md5 - Please help wadi wadi Python 8 10-30-2009 08:37 AM
Re: Python 2.5.2 error on Solaris, No module named _md5 skip@pobox.com Python 0 12-11-2008 10:50 PM
ImportError: No module named _md5 neridaj@gmail.com Python 1 07-01-2008 08:14 PM
Getting importError: No module named _md5 jeffself Python 2 06-27-2007 06:48 PM
ImportError: No module named lang - Serious Jython newbie - Please help! javahead Python 1 10-08-2003 08:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57