0

An attempt to install an evdev equivalent fails:

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

Second attempt with -H flag

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. To diagnose the your TLS version:

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

My TLS version returned 1.0.

Questions

  1. Is the above information enough to define the installation failure?
  2. What tests must be performed to diagnose for corrective action?
  3. If there is sufficient info, what is the proper corrective action?
  4. What exactly is the 'interpreter' (part of Python? part of pip?) and how is this upgraded?
gatorback
  • 745
  • 1
  • 8
  • 36
  • Possible duplicate of [Not able to install python packages \[SSL: TLSV1\_ALERT\_PROTOCOL\_VERSION\]](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version) – phd May 13 '18 at 19:43

1 Answers1

1
  1. Yes. An installation failure just means it didn't install so the one true test would be trying to import the module and it failing.

  2. Simply installing should be a fine test as long as you can see most or all of the error log.

  3. It seems like you don't have access to the Computer's Pip directory which can be solved by adding the --user flag. And Pip also can't find the name of your requested module. Either because it's not on PyPi or because an internet/https issue Make sure it's on PyPi or install from a .whl file, which can be found for most modules by googling.

Preston Hager
  • 1,314
  • 14
  • 26