安装PIP时出错 - TypeError: ()需要3个参数(给定0)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装PIP时出错 - TypeError: ()需要3个参数(给定0)相关的知识,希望对你有一定的参考价值。

我正在尝试在macOS Sierra上安装pip:sudo easy_install pip

我收到以下错误:

Traceback (most recent call last):
  File "/usr/bin/easy_install-2.7", line 7, in <module>
    from pkg_resources import load_entry_point
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3036, in <module>
    @_call_aside
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3020, in _call_aside
    f(*args, **kwargs)
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 656, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 669, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 862, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2568, in requires
    dm = self._dep_map
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2557, in _dep_map
    if invalid_marker(marker):
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 1416, in invalid_marker
    evaluate_marker(text)
  File "/Users/davidg/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 1433, in evaluate_marker
    marker = packaging.markers.Marker(text)
  File "/Library/Python/2.7/site-packages/packaging/markers.py", line 276, in __init__
    self._markers = _coerce_parse_result(MARKER.parseString(marker))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py", line 1031, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py", line 905, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py", line 2288, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py", line 931, in _parseNoCache
    tokens = fn( instring, tokensStart, retTokens )
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyparsing.py", line 695, in wrapper
    ret = func(*args[limit[0]:])
TypeError: <lambda>() takes exactly 3 arguments (0 given)

我在网上找不到任何解决方案。如果我得到任何帮助,我将不胜感激。谢谢。

答案

我做了'python -m pip install --upgrade --force pip'并且它工作正常

以上是关于安装PIP时出错 - TypeError: ()需要3个参数(给定0)的主要内容,如果未能解决你的问题,请参考以下文章

导入 TensorFlow 时出错。 TypeError:预期字节,找到描述符

尝试在 openSUSE 上安装 pip 时出错

通过 pip 安装 gnureadline 时出错

使用 pip 安装 Dlib 时出错

安装 pip pyicu 时出错

当我尝试使用 pip 安装 Dlib 时出错。苹果系统