PIP安装失败

时间:2018-05-13 03:40:41

标签: pip osx-mavericks

尝试安装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的一部分?)以及如何升级?

1 个答案:

答案 0 :(得分:1)

  1. 是。安装失败只是意味着它没有安装,因此一个真正的测试将尝试导入模块并且失败。

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

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

相关问题