升级到最新的pip导致ValueError

时间:2016-01-21 00:31:15

标签: python pip pypi

最新升级到pip(使用Python 3.5)会导致任何pip命令出现以下错误:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pip3.5", line 7, in <module>
    from pip import main
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/__init__.py", line 15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/vcs/subversion.py", line 9, in <module>
    from pip.index import Link
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/index.py", line 29, in <module>
    from pip.wheel import Wheel, wheel_ext
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/wheel.py", line 32, in <module>
    from pip import pep425tags
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/pep425tags.py", line 214, in <module>
    supported_tags = get_supported()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/pep425tags.py", line 162, in get_supported
    arch = get_platform()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/pep425tags.py", line 119, in get_platform
    major, minor, micro = release.split('.')
ValueError: not enough values to unpack (expected 3, got 2)

我甚至无法升级或卸载。造成这种情况的原因是什么?如何修复?

1 个答案:

答案 0 :(得分:0)

我继续编辑

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/pep425tags.py

第120行。

删除了micro值,现在又可以使用了。不确定发生了什么。