0

我搜索了很多,没有找到任何答案=(

我有一个 CentOS 5 作为服务器,遵循这个如何: http ://wiki.osqa.net/display/docs/RHEL%2C+CentOS+5+Installation+Guide#RHEL%2CCentOS5InstallationGuide-Python

我能够安装与 yum 版本分开的 python 2.6。但是当我运行 ./easy_install ElementTree 时,我得到了这个奇怪的错误:

    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

我不懂 python 也不知道如何解决这个问题,我正在尝试安装 OSQA 来运行另一个国家的 phpBB 支持论坛。

感谢您的帮助,最好的问候。

4

5 回答 5

1

我的猜测是之前在 CentOS 上遇到过类似的问题,新 Python 的 ld 路径没有设置,并且找不到它的可加载模块文件夹。

此博客文章中的第三个代码块显示为 opt Python 设置 ld 路径(尽管它是 2.7):http ://toey.tc20.net/2010/08/04/install-python-2-7-gevent-在-centos-5-x86_64/

我会假设安装程序会在安装步骤中完成此操作,但也许上面的博客文章会有所帮助。

于 2010-11-25T16:14:24.250 回答
1

我遇到了同样的问题,发现该问题与 _md5.so 无关,而是 hashlib 未能在 try 块中导入 _hashlib.so,然后进入不同且通常未使用的代码部分(其中 _md5 问题显示向上)。尝试:

import _hashlib.so

我得到了类似的东西:

ImportError: <PATH>/lib/python2.7/lib-dynload/_hashlib.so: cannot restore segment prot after reloc: Permission denied

我用谷歌搜索,发现http://www.quantumwise.com/forum/index.php?topic=16.0说你需要做:

chcon -t texrel_shlib_t <PATH>/lib/python2.7/lib-dynload/_hashlib.so

这对我有用。

于 2011-05-26T17:05:36.820 回答
0

Activepython 2.6 在他们的最新版本中似乎有一些问题。请检查其以前的版本。

于 2010-12-22T03:59:08.270 回答
0

我也遇到了和你一样的问题,我在添加将安装模块的python的lib路径后修复它。

确实LD_LIBRARY_PATHLD_LIBRARY_PATH.

setenv LD_LIBRARY_PATH /opt/ActivePython-2.6/lib:$LD_LIBRARY_PATH
于 2011-10-15T10:08:28.977 回答
0

归功于http://johnsofteng.wordpress.com/2009/06/21/python-importerror-no-module-named-_md5/

我在 Redhat 6.4 上遇到了类似的问题,python 二进制(2.7.x)包是从其他已安装的系统(从源代码构建的)复制的。

问题是_hashlib.so,它错过了libssl.so.0.9.8

bash-4.1# ldd /proj/application/tools/python2.7/lib/python2.7/lib-dynload/_hashlib.so
    linux-vdso.so.1 =>  (0x00007fff51d6f000)
    libssl.so.0.9.8 => not found
    libcrypto.so.0.9.8 => /usr/lib64/libcrypto.so.0.9.8 (0x00007f9a69746000)
    libpython2.7.so.1.0 => /proj/application/tools/python2.7/lib/libpython2.7.so.1.0 (0x00007f9a6936b000)

我只是安装错过的包和库的软链接。

bash-4.1# yum install -y tar openssh-clients
bash-4.1# ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8

然后setuptool安装成功

于 2014-06-06T04:57:54.937 回答