Search code examples
pythoneasy-install

python using easy_install ImportError: No module named _md5


I searched a lot and did not find any answer to this problem =(

I have a CentOS 5 as a server, following this How To: http://wiki.osqa.net/display/docs/RHEL%2C+CentOS+5+Installation+Guide#RHEL%2CCentOS5InstallationGuide-Python

I'm able to install python 2.6 separated from the yum version. But when I run ./easy_install ElementTree I get this strange error:

    Traceback (most recent call last):
  File "./easy_install", line 9, in <module>
    load_entry_point('distribute==0.6.14', 'console_scripts', 'easy_install')()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/pkg_resources.py", line 305, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/pkg_resources.py", line 2244, in load_entry_point
    return ep.load()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 24, in <module>
    from setuptools.package_index import PackageIndex
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools/package_index.py", line 2, in <module>
    import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO
  File "/opt/ActivePython-2.6/lib/python2.6/urllib2.py", line 93, in <module>
    import hashlib
  File "/opt/ActivePython-2.6/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/opt/ActivePython-2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5

I do not understand python and have no idea how to fix this issue, I'm trying to install OSQA to run a phpBB support forum for another country.

Thanks for any help, best regard's.


Solution

  • My guess having had a similar issue on CentOS before, is that the ld path for the new Python isn't set, and it can't find its loadable modules folder.

    The 3rd code block on this blog post shows setting an ld path for an opt Python (though it is 2.7): http://toey.tc20.net/2010/08/04/install-python-2-7-gevent-on-centos-5-x86_64/

    I would assume that an installer would have done this as part of the install step, but maybe the blog post above will be of some help.