Opened 13 years ago

Closed 12 years ago

#31799 closed defect (wontfix)

python25 fails to import hashlib with user-installed modules in ~/Library/Python/2.5/site-packages

Reported by: gthb (Gunnlaugur Thor Briem) Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: jmroot (Joshua Root)
Port: python25 py25-distribute

Description

Platform: Lion/XCode4.2

$ port installed python25
The following ports are currently installed:
  python25 @2.5.6_1 (active)

Salient part of main.log:

:info:destroot   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 63, in __get_builtin_constructor
:info:destroot     import _sha256
:info:destroot ImportError: No module named _md5
:info:destroot shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-distribute/py25-distribute/work/distribute-0.6.24-" && /opt/local/bin/python2.5 setup.py 
:error:destroot Target org.macports.destroot returned: shell command failed (see log for details)

Full main.log is attached

Attachments (3)

py25-distribute.main.log (71.5 KB) - added by gthb (Gunnlaugur Thor Briem) 13 years ago.
main.log from the failed install
python25.main.log (4.4 MB) - added by gthb (Gunnlaugur Thor Briem) 13 years ago.
main.log from port install -k -d python25
python25.contents.txt (197.7 KB) - added by gthb (Gunnlaugur Thor Briem) 13 years ago.
result of port contents python25

Change History (11)

Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

Attachment: py25-distribute.main.log added

main.log from the failed install

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to jwa@…
Port: python25 added

If the _md5 module doesn't exist/work then that's a problem with python25.

comment:2 Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

OK ... then possibly it's relevant that I just got the python25 build working today after #31697 was resolved

comment:3 Changed 13 years ago by jmroot (Joshua Root)

I can't reproduce this. Does import hashlib work in your python2.5?

The only interesting part of your log apart from the error itself seems to be this:

:info:build failed to import Cython: dlopen(/Users/gthb/Library/Python/2.5/site-packages/Cython-0.11.1-py2.5-macosx-10.5-i386.egg/Cython/Compiler/Scanning.so, 2): no suitable image found.  Did find:
:info:build 	/Users/gthb/Library/Python/2.5/site-packages/Cython-0.11.1-py2.5-macosx-10.5-i386.egg/Cython/Compiler/Scanning.so: no matching architecture in universal wrapper

comment:4 Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

Nope:

>>> import hashlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 136, in <module>
    sha256 = __get_builtin_constructor('sha256')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 63, in __get_builtin_constructor
    import _sha256
ImportError: No module named _md5

That ~/Library/Python/2.5/site-packages/Cython-0.11.1-py2.5-macosx-10.5-i386.egg bit in the install log ... that's the site-packages from an old non-macports Python installation on my machine, and I would have thought it shouldn't be touched by the macports one. Am I wrong, or is there a need to go troubleshoot why this site-packages was referenced?

comment:5 Changed 13 years ago by jmroot (Joshua Root)

OK, so hashlib is clearly the problem (it works fine for me). I wouldn't think cython would affect any of this, and it doesn't seem to stop setup.py when the cython error occurs. I'd only go after that lead if no other explanation can be found.

Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

Attachment: python25.main.log added

main.log from port install -k -d python25

Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

Attachment: python25.contents.txt added

result of port contents python25

comment:6 Changed 13 years ago by gthb (Gunnlaugur Thor Briem)

It was indeed due to the old messy ~/Library/Python/2.5/site-packages — I clean-swept that directory (leaving only setuptools and the .pth files with all other packages stripped out) and now hashlib imports without problems and py25-distribute installs just fine.

I'm not clear on install conventions, so not sure whether the presence of cruft in ~/Library/Python/2.5/site-packages should have had this effect (or whether it was my bad).

comment:7 Changed 13 years ago by jmroot (Joshua Root)

Summary: py25-distribute fails setup: "ImportError: No module named _md5"python25 fails to import hashlib with user-installed modules in ~/Library/Python/2.5/site-packages

comment:8 Changed 12 years ago by jmroot (Joshua Root)

Resolution: wontfix
Status: newclosed

Guess we'll call this an upstream bug.

Note: See TracTickets for help on using tickets.