I installed Cent OS on a virtual machine, and it comes with Python 2.4 out of the box. I needed to install Python 2.6, so I installed a separat开发者_运维知识库e python binary from ActivePython which installed itself in a different directory. When I run pip (/opt/ActivePython-2.6/bin/pip
) I get this error:
# pip
Traceback (most recent call last):
File "/opt/ActivePython-2.6/bin/pip", line 9, in <module>
load_entry_point('pip==0.8.1', 'console_scripts', 'pip')()
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/pip/__init__.py", line 10, in <module>
from pip.basecommand import command_dict, load_command, load_all_commands, command_names
File "/opt/ActivePython-2.6/lib/python2.6/site-packages/pip/basecommand.py", line 11, in <module>
import urllib2
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've never seen this error before, and I don't understand why it would try calling _md5 when the library is just 'md5'. When I attempted symlinking _md5.py to md5.py I get the same error but with ImportError: No module named _md5
.
Find _md5.so
in /opt/ActivePython-2.6
and run ldd
on it. Yeah.
Install EPEL
, install python26
via yum, have fun.
精彩评论