【问题标题】:PIP installation failurePIP 安装失败
【发布时间】:2018-10-23 01:33:38
【问题描述】:

尝试安装evdev equivalent 失败:

Users-MacBook-Air:~ user$ sudo pip install hidapi
The directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting hidapi
  Could not fetch URL https://pypi.python.org/simple/hidapi/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement hidapi (from versions: )
No matching distribution found for hidapi

第二次尝试使用 -H 标志

Users-MacBook-Air:~ user$ sudo -H pip install hidapi
Could not fetch URL https://pypi.python.org/simple/hidapi/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement hidapi (from versions: )
No matching distribution found for hidapi

The TLSV1 error is because the interpreter does not support TLS v1.2, you must upgrade your interpreter. 诊断您的 TLS 版本:

python -c "import json, urllib2; print json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))['tls_version']"

我的 TLS 版本返回 1.0。

问题

  1. 以上信息是否足以定义安装失败?
  2. 必须执行哪些测试来诊断纠正措施?
  3. 如果有足够的信息,正确的纠正措施是什么?
  4. “解释器”到底是什么(Python 的一部分?pip 的一部分?),它是如何升级的?

【问题讨论】:

标签: pip osx-mavericks


【解决方案1】:
  1. 是的。安装失败只是意味着它没有安装,所以一个真正的测试是尝试导入模块并且它失败了。

  2. 只要您能看到大部分或全部错误日志,只需安装即可。

  3. 您似乎无权访问计算机的 Pip 目录,这可以通过添加 --user 标志来解决。而且 Pip 也找不到您请求的模块的名称。要么因为它不在 PyPi 上,要么因为 Internet/https 问题确保它在 PyPi 上或从.whl 文件安装,大多数模块可以通过谷歌搜索找到该文件。

【讨论】:

    猜你喜欢
    • 2014-09-07
    • 2016-09-25
    • 2021-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多