Python Pip安装错误

Python Pip安装错误,python,pip,codec,easy-install,Python,Pip,Codec,Easy Install,每当我尝试使用pip时,我都会收到以下错误: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 5, in <module> from pkg_resources import load_entry_point File "/Library/Frameworks/Python.framework/Versions/2

每当我尝试使用
pip
时,我都会收到以下错误:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 720, in <module>
    class Environment(object):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 723, in Environment
    def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 109, in get_supported_platform
    plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 221, in _macosx_vers
    version = platform.mac_ver()[0]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 804, in mac_ver
    info = _mac_ver_xml()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 781, in _mac_ver_xml
    pl = plistlib.readPlist(fn)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
    parser.ParseFile(fileobj)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 418, in handleEndElement
    handler()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 452, in end_key
    self.currentKey = self.getData()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 436, in getData
    data = data.encode("ascii")
LookupError: no codec search functions registered: can't find encoding
回溯(最近一次呼叫最后一次):
文件“/Library/Frameworks/Python.framework/Versions/2.7/bin/pip”,第5行,在
从打包资源导入加载入口点
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site packages/pkg_resources.py”,第720行,在
类环境(对象):
环境中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site packages/pkg_resources.py”,第723行
def uuu init uuuu(self,search_path=None,platform=get_supported_platform(),python=PY_MAJOR):
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site packages/pkg_resources.py”,第109行,在get_-supported_平台中
plat='macosx-%s-%s'('..join('macosx_vers()[:2]),m.group(3))
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site packages/pkg_resources.py”,第221行,在macosx版本中
version=platform.mac\u ver()[0]
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py”,第804行,mac版本
info=\u mac\u ver\u xml()
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py”,第781行,格式为xml
pl=plistlib.readPlist(fn)
readPlist中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”,第78行
rootObject=p.parse(pathOrFile)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”,第406行,在parse中
parser.ParseFile(fileobj)
handleEndElement中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”,第418行
handler()
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”,第452行,结尾处
self.currentKey=self.getData()
getData中的文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”,第436行
数据=数据编码(“ascii”)
LookupError:未注册编解码器搜索函数:找不到编码

尝试运行
sudo easy\u install pip
会产生相同的消息。我以前曾使用过
pip
,并在尝试为项目安装
virtualenv
时收到此消息。我想不出任何最近的更新或系统更改会导致这种情况。以前有人遇到过此错误消息吗?

我可以说,这是一个OS X M-Lion。这是本机安装吗?您得到了什么?编码(“ascii”)?我建议您按照以下教程一步一步地在mac lion(或lion mountain)上正确安装所有内容: