python2.5 importerror on md5

Steve Holden steve at holdenweb.com
Mon Oct 23 16:10:05 EDT 2006


samn wrote:
>>I believe the _md5 module (as opposed to the md5 module) is a compiled
>>extension. I'm guessing the import succeeds on the machine you used to
>>build python.
>>
>>Try
>>
>>   import _md5
>>   print _md5.__file__
>>
>>and see if you can find out where it's being loaded from. You'll
>>probably find that you also need to tailor the sysprefix parameter, or
>>some such.
>>
> 
> 
> You are correct that import md5 works fine on the machine that I
> compiled on and only has problems on the other machine. I wasn't able
> to import _md5 , even on the machine I compiled on.
> Here's what I get on the machine I compiled on:
> Python 2.5 (r25:51908, Oct 23 2006, 13:38:11)
> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)] on linux2
> 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 md5
>>>>print md5.__file__
> 
> /usr/arch/lib/python2.5/md5.py
> 
> sys.prefix is equal on both machines:
> 
>>>>import sys
>>>>sys.prefix
> 
> '/usr/arch'
> 
> thanks for any help
> sam
> 
Try looking for md5.so - it'll probably be somewhere like 
/usr/lib/python2.5/lib-dynload. When I said sys-prefix I meant the 
--exec-prefix configuration option, but actually I'm not sure what 
determines where shared libraries end up.

At least knowing what you are looking for should help. This may affect 
other modules that use extension support.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list