473,549 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python2.5 importerror on md5

i compiled and installed the release version of python 2.5 for linux to
a directory accessible to 2 computers, configured with
--prefix=/usr/arch (which is accessible to both machines). the
installation went fine and when i run python on one machine i can do
from hashlib import * without a problem. on the other machine i get the
following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/arch/lib/python2.5/hashlib.py", line 104, in <module>
md5 = __get_builtin_c onstructor('md5 ')
File "/usr/arch/lib/python2.5/hashlib.py", line 31, in
__get_builtin_c onstructor
import _md5
ImportError: No module named _md5

I have the file md5.py , md5.pyo , and md5.pyc in
/usr/arch/lib/python2.5/ so I don't know why python is having a problem
finding the md5 module...

The sys.path is equal on both machines :
['', '/usr/arch/lib/python25.zip', '/usr/arch/lib/python2.5',
'/usr/arch/lib/python2.5/plat-linux2',
'/usr/arch/lib/python2.5/lib-tk',
'/usr/arch/lib/python2.5/lib-dynload',
'/usr/arch/lib/python2.5/site-packages',
'/usr/arch/lib/python2.5/site-packages/gtk-2.0']

Here is the version info :
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

If anyone has encountered similar problems or knows of a way to
fix/suggestions please let me know.

Thanks in advance.
Sam

Oct 23 '06 #1
6 22463
samn wrote:
i compiled and installed the release version of python 2.5 for linux to
a directory accessible to 2 computers, configured with
--prefix=/usr/arch (which is accessible to both machines). the
installation went fine and when i run python on one machine i can do
from hashlib import * without a problem. on the other machine i get the
following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/arch/lib/python2.5/hashlib.py", line 104, in <module>
md5 = __get_builtin_c onstructor('md5 ')
File "/usr/arch/lib/python2.5/hashlib.py", line 31, in
__get_builtin_c onstructor
import _md5
ImportError: No module named _md5

I have the file md5.py , md5.pyo , and md5.pyc in
/usr/arch/lib/python2.5/ so I don't know why python is having a problem
finding the md5 module...

The sys.path is equal on both machines :
['', '/usr/arch/lib/python25.zip', '/usr/arch/lib/python2.5',
'/usr/arch/lib/python2.5/plat-linux2',
'/usr/arch/lib/python2.5/lib-tk',
'/usr/arch/lib/python2.5/lib-dynload',
'/usr/arch/lib/python2.5/site-packages',
'/usr/arch/lib/python2.5/site-packages/gtk-2.0']

Here is the version info :
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

If anyone has encountered similar problems or knows of a way to
fix/suggestions please let me know.
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.

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

Oct 23 '06 #2
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

Oct 23 '06 #3
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.prefi x

'/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

Oct 23 '06 #4
i think the problem is different versions of openssl on the two
machines , 0.9.7a and 0.9.8b

Oct 23 '06 #5
On Mon, Oct 23, 2006 at 01:28:46PM -0700, samn wrote:
i think the problem is different versions of openssl on the two
machines , 0.9.7a and 0.9.8b
I second that this is the likely culprit. I got bit by it while trying to
do cross compile. The module build process assumes a couple of locations that
a particular library might be and takes the first one it finds, regardless of
which one you actually want it to use. I ended up making modifications to
what modules were installed to get md5 to finally import.

My experiences are outlined at this page:
http://whatschrisdoing.com/blog/2006...ile-python-25/

-Chris
Oct 23 '06 #6

Chris Lambacher wrote:
On Mon, Oct 23, 2006 at 01:28:46PM -0700, samn wrote:
i think the problem is different versions of openssl on the two
machines , 0.9.7a and 0.9.8b
I second that this is the likely culprit. I got bit by it while trying to
do cross compile. The module build process assumes a couple of locations that
a particular library might be and takes the first one it finds, regardless of
which one you actually want it to use. I ended up making modifications to
what modules were installed to get md5 to finally import.

My experiences are outlined at this page:
http://whatschrisdoing.com/blog/2006...ile-python-25/

-Chris
thanks , i actually ended up installing openssl 0.9.8b on the machine
with version 0.9.7a and then reinstalling hashlib (after taking out
part of setup.py that doesn't let you install for python >= 2.5) in the
right place and then it worked

Oct 23 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4542
by: Carsten Gehling | last post by:
Figured out myself - I just removed the line with "from url import Url" -it doesn't seem to be used anywhere ;-) - Carsten > -----Oprindelig meddelelse----- > Fra: python-list-admin@python.org > På vegne af Carsten Gehling > Sendt: 16. juli 2003 16:24
1
2241
by: Scott Silliman | last post by:
I'm getting the following when I run my executable: File "/usr/lib/python2.2/socket.py", line 41, in ? from _socket import * ImportError: /usr/lib/python2.2/lib-dynload/_socketmodule.so: undefined symbol: PyInt_FromLong However, if I run 'nm' on the executable, I get the following output: 0807cf90 T PyInt_FromLong
1
4219
by: Jeremy C. Reed | last post by:
Configuring gramps (genealogy software) says: checking Python bindings for gtk... ok checking Python bindings for GNOME... ok checking Python bindings for gconf... Traceback (most recent call last): File "conftest.py", line 17, in ? import gnome.gconf ImportError: No module named gconf cat: conftest.out: No such file or directory...
3
3484
by: draghuram | last post by:
Hi, I have a python script that pickles and unpickles a give object. It works without any problems on windows (the data was pickled on windows first). But when I try to run the script on Linux, I get the following error: mydbinfo = pickle.Unpickler(f).load() File "/usr/lib/python2.3/pickle.py", line 872, in load dispatch(self)
4
2047
by: Lars | last post by:
Hi, I have problems building a simple handcoded C-extension (hello.c) with Cygwin and gcc3.4.4. I hope somebody has encountered the same problem before, and has some advice. The extension works just fine with Linux: gcc -c hello.c -I/usr/local/include/python2.4/ ld -shared hello.o -o hello.so -L /usr/local/lib/ -lpython2.4 -lc
2
2166
by: Adam Blinkinsop | last post by:
I'm writing a set of modules to monitor remote system services, and I'm having a problem running my test scripts. When I pass the scripts into python, like so: -- $ PYTHONPATH="${TARGET_DIR}" python test.py -- I get an ImportError:
0
4368
by: çÌÏÔÏ× áÒÔÅÍ | last post by:
Hello! I'm trying to install the web application written with Python, and have the trouble with module math.so: # lwp-request http://localhost/site/code/edit.py Mod_python error: "PythonHandler edit::handler" Traceback (most recent call last):
1
3270
by: kaush | last post by:
Hi All, I have a simple python script saved to "test.py" as import os import base64 def Testfunction(): print "Hello World" return
1
5794
by: neridaj | last post by:
Hello, Does anyone know how to fix this error when trying to build MySQL- python-1.2.2: python setup.py build Traceback (most recent call last): File "setup.py", line 5, in <module> import ez_setup; ez_setup.use_setuptools() File "/Users/jasonnerida/Downloads/MySQL-python-1.2.2/ez_setup.py",
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7962
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.