繁体   English   中英

python pip安装失败

[英]python pip install failures

我试图安装一个库pynput使用sudo PIP安装pynput

但我收到此错误日志。 任何其他python包都会发生这种情况。 一切以前工作正常突然出现这些错误我试图从中复制错误日志

〜/将该.pip / pip.log

这就是我所拥有的:

 Using version 1.4 (newest of versions: 1.4, 1.3.10, 1.3.9, 1.3.8.1, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3, 1.2, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0, 0.6, 0.5.1, 0.5, 0.4, 0.3, 0.2)
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files
    do_download,
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
    self.session,
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 546, in unpack_http_url
    resp = session.get(target_url, stream=True)
  File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 467, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 237, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 330, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 562, in urlopen
    body=body, headers=headers)
  File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1051, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 864, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 826, in send
    self.connect()
  File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 145, in connect
    match_hostname(self.sock.getpeercert(),
  File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 313, in getpeercert
    for value in get_subj_alt_name(x509)
  File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 94, in get_subj_alt_name
    asn1Spec=general_names)
  File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 825, in __call__
    stGetValueDecoder, self, substrateFun
  File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 391, in valueDecoder
    r.verifySizeSpec()
  File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/base.py", line 252, in verifySizeSpec
    def verifySizeSpec(self): self._sizeSpec(self)
  File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/constraint.py", line 32, in __call__
    '%s failed at: \"%s\"' % (self, sys.exc_info()[1])
ValueConstraintError: ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(1, 64)) failed at: "ValueSizeConstraint(1, 64) failed at: "SubjectAltName().setComponents(GeneralName(componentType=NamedTypes(NamedType('otherName', AnotherName(componentType=NamedTypes(NamedType('type-id', ObjectIdentifier('<no value>')), NamedType('value', ...........

这里存在类似的问题。

问题似乎是PyPI证书现在有超过64个SAN名称,打破了旧版本请求中的硬编码最大值。

确保您拥有请求和urllib3模块的最新版本。

我得到了它的工作。 从中删除requestsurllib

/usr/local/lib/python2.7/dist-packages

并使用sudo easy_install requests重新安装sudo easy_install requests

然后sudo easy_install pip==9.0.1

尝试使用更新点子

sudo -H pip2 install --upgrade pip

命令。

下面的解决方案为我工作

  1. 卸载pip2
  2. 使用PyPI安装pip2(请参阅https://www.howtodojo.com/2016/03/install-use-pip-ubuntu-14-04/中的 '从PyPI安装pip'部分)注意:从ubuntu存储库安装没有在我的情况下工作。
  3. 然后我在使用pip2安装任何模块时不再获得ValueConstraintError(例如:pip2 install invoke)

你需要更新点子。 只需输入此命令即可

curl  https://bootstrap.pypa.io/get-pip.py | sudo python

更新后bash -l

而已。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM