[MacPorts] #19461: py26-xml: ImportError: No module named _md5
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Hi, This error was already reported in other contexts for Python 2.5, and people were told to install py25-hashlib. But there is no such thing for py26. {{{ #!python akim@montero ~/src/kernel $ python2.6 2 14:10:08 Python 2.6.1 (r261:67515, Apr 2 2009, 14:20:17) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from xml.sax import saxexts, saxlib, saxutils Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages/_xmlplus/sax/saxutils.py", line 8, in <module> import os, urlparse, urllib2, types File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 91, in <module> import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 136, in <module> md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor import _md5 ImportError: No module named _md5
}}}
-- Ticket URL: <http://trac.macports.org/ticket/19461> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Comment(by blb@…): Your example import works fine for me: {{{ Python 2.6.2 (r262:71600, Apr 24 2009, 17:25:56) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from xml.sax import saxexts, saxlib, saxutils
}}} This is with the following python26 and py26-xml installed: {{{ py26-xml @0.8.4_0 (active) python26 @2.6.2_1 (active) }}} Note that there is no py26-hashlib as its functionality should be built into python26. Does the following file exist on your install? {{{ /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so }}}
-- Ticket URL: <http://trac.macports.org/ticket/19461#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Comment(by akim.demaille@…): Replying to [comment:1 blb@…]:
Note that there is no py26-hashlib as its functionality should be built into python26. Does the following file exist on your install? {{{
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so
}}}
Yes, it does: {{{ $ ls -l /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so -rwxr-xr-x 2 root admin 21748 Apr 2 14:20 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so }}} But there is no _md5.so, shouldn't there be one? I have the same ports as you: {{{ $ port echo active | grep py py26-docutils @0.5_1 py26-libxml2 @2.6.21_0 py26-xml @0.8.4_0 python26 @2.6.1_2 python_select @0.2.1_0+darwin_9 swig @1.3.38_0+perl+php5+python+ruby xorg-libxcb @1.2_0+python26 xorg-xcb-proto @1.4_0+python26 }}} and still the error. {{{ $ python2.6 Python 2.6.1 (r261:67515, Apr 2 2009, 14:20:17) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from xml.sax import saxexts, saxlib, saxutils Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages/_xmlplus/sax/saxutils.py", line 8, in <module> import os, urlparse, urllib2, types File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 91, in <module> import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 136, in <module> md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor import _md5 ImportError: No module named _md5 }}}
I don't know what to look for. I am no Python programmer, I don't know how to ask it its path. -- Ticket URL: <http://trac.macports.org/ticket/19461#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Comment(by akim.demaille@…): All this boils down to this, I guess: {{{ #!python $ python2.6 [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import md5 __main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/md5.py", line 10, in <module> from hashlib import md5 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 136, in <module> md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor import _md5 ImportError: No module named _md5 }}}
-- Ticket URL: <http://trac.macports.org/ticket/19461#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Comment(by blb@…): Hmm, perhaps the build didn't properly link to OpenSSL; what is the result of running the following two commands? {{{ $ python2.6 -c 'import _hashlib;print dir(_hashlib)' $ port installed openssl }}} -- Ticket URL: <http://trac.macports.org/ticket/19461#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 -------------------------------------+-------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Keywords: | Port: py26-xml -------------------------------------+-------------------------------------- Comment(by akim.demaille@…): Replying to [comment:4 blb@…]:
Hmm, perhaps the build didn't properly link to OpenSSL; what is the result of running the following two commands? {{{ $ python2.6 -c 'import _hashlib;print dir(_hashlib)' $ port installed openssl }}}
{{{ $ python2.6 -c 'import _hashlib;print dir(_hashlib)' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so, 2): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-dynload/_hashlib.so Reason: image not found $ port installed openssl The following ports are currently installed: openssl @0.9.8k_0 (active) $ ls /opt/local/lib/libssl.* /opt/local/lib/libssl.0.9.8.dylib /opt/local/lib/libssl.a /opt/local/lib/libssl.dylib }}} So I reinstalled python26 and now this works properly. My problems with ssl.1.0.0 were reported in another ticket (http://trac.macports.org/ticket/19124). Now: {{{
import md5; __main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead }}}
It does work now. So I basically had you debug my machine :( Sorry about that. -- Ticket URL: <http://trac.macports.org/ticket/19461#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19461: py26-xml: ImportError: No module named _md5 --------------------------------------+------------------------------------- Reporter: akim.demaille@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.7.1 Resolution: invalid | Keywords: Port: py26-xml | --------------------------------------+------------------------------------- Changes (by jmr@…): * status: new => closed * resolution: => invalid -- Ticket URL: <http://trac.macports.org/ticket/19461#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts