[英]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 我有一个CentOS 5作为服务器,遵循以下方法: 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. 我能够安装与yum版本分开的python 2.6。 But when I run ./easy_install ElementTree I get this strange error: 但是当我运行./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
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. 我不了解python,也不知道如何解决此问题,我正在尝试安装OSQA,以便为另一个国家/地区运行phpBB支持论坛。
Thanks for any help, best regard's. 感谢您的帮助,最好的考虑。
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. 我之前在CentOS上遇到类似问题的猜测是,新Python的ld路径没有设置,也找不到它的可加载模块文件夹。
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/ 该博客文章的第3个代码块显示了为opt Python(虽然是2.7)设置ld路径: http : //toey.tc20.net/2010/08/04/install-python-2-7-gevent-上的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. 我认为安装程序会在安装步骤中完成此操作,但是上面的博客文章可能会有所帮助。
I had the same problem and found that the issue is unrelated to _md5.so, but instead that hashlib is failing to import _hashlib.so within a try block, then getting to a different and normally unused section of code (where the _md5 problem shows up). 我遇到了同样的问题,发现该问题与_md5.so无关,但是hashlib无法在try块中导入_hashlib.so,然后转到不同的且通常未使用的代码部分(其中_md5问题显示了向上)。 Try: 尝试:
import _hashlib.so
I got something like: 我有类似的东西:
ImportError: <PATH>/lib/python2.7/lib-dynload/_hashlib.so: cannot restore segment prot after reloc: Permission denied
I googled that and found http://www.quantumwise.com/forum/index.php?topic=16.0 which says you need to do: 我用Google搜索并找到http://www.quantumwise.com/forum/index.php?topic=16.0 ,其中说你需要这样做:
chcon -t texrel_shlib_t <PATH>/lib/python2.7/lib-dynload/_hashlib.so
This worked for me. 这对我有用。
Credit to http://johnsofteng.wordpress.com/2009/06/21/python-importerror-no-module-named-_md5/ 感谢http://johnsofteng.wordpress.com/2009/06/21/python-importerror-no-module-named-_md5/
I met the similar problem on Redhat 6.4, python binary (2.7.x) packages is copied from other already installed system (which is built from source). 我在Redhat 6.4上遇到了类似的问题,python二进制(2.7.x)包是从其他已经安装的系统(从源代码构建)复制而来的。
The problem is the _hashlib.so, which miss the libssl.so.0.9.8 问题是_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)
I just install missed package and soft link to the library. 我只是安装错过的软件包和软件链接到库。
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
Then the setuptool installation is successful 然后setuptool安装成功
Activepython 2.6 seems to have some problem in their latest build. Activepython 2.6在其最新版本中似乎存在一些问题。 please check for its former release. 请检查它以前的版本。
I also encounter the same issue like you, I fix it after I add the lib path of python where the module will be installed. 我也遇到了和你一样的问题,我在添加了安装模块的python的lib路径后修复了它。
It is really caused by LD_LIBRARY_PATH
, please try to add "/opt/ActivePython-2.6/lib" into your LD_LIBRARY_PATH
. 它确实是由LD_LIBRARY_PATH
引起的,请尝试将“/opt/ActivePython-2.6/lib”添加到LD_LIBRARY_PATH
。
setenv LD_LIBRARY_PATH /opt/ActivePython-2.6/lib:$LD_LIBRARY_PATH
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.