Explorer HAT Pro installation error


#1

Hi there,

I am facing error below while installing library - following https://github.com/pimoroni/explorer-hat to RPI 3 with clean, updated Raspbian:

Unable to install smbus for python 3!
Python 3 library install failed!

pi@raspberrypi:~ $ curl -sS get.pimoroni.com/explorerhat | bash

This script will install everything needed to use
the Pimoroni Explorer HAT/pHAT

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
\curl -sS https://get.pimoroni.com/explorerhat

Note: Explorer HAT/pHAT requires I2C communication

Do you wish to continue? [y/N] y

Checking environment…

Reading package lists… Done

Checking hardware requirements…

Checking for packages required for GPIO control…
Rpi.GPIO installed and up-to-date

I2C already enabled

Checking packages required by I2C interface…

Traceback (most recent call last):
File “/usr/bin/pip3”, line 9, in
load_entry_point(‘pip==1.5.6’, ‘console_scripts’, ‘pip3’)()
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python3/dist-packages/pip/init.py”, line 74, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File “/usr/lib/python3/dist-packages/pip/vcs/mercurial.py”, line 9, in
from pip.download import path_to_url
File “/usr/lib/python3/dist-packages/pip/download.py”, line 25, in
from requests.compat import IncompleteRead
ImportError: cannot import name 'IncompleteRead’
Unable to install smbus for python 3!

Explorer HAT/pHAT comes with examples and documentation that you may wish to install.
Performing a full install will ensure those resources are installed,
along with all required dependencies. It may however take a while!

Do you wish to perform a full install? [y/N] y
Checking install requirements…

Checking for dependencies…

python-dev is already installed
python3-dev is already installed

Installing Explorer HAT/pHAT library for Python 2…

Requirement already up-to-date: explorerhat in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: cap1xxx in /usr/local/lib/python2.7/dist-packages (from explorerhat)
Cleaning up…

Installing Explorer HAT/pHAT library for Python 3…

Traceback (most recent call last):
File “/usr/bin/pip3”, line 9, in
load_entry_point(‘pip==1.5.6’, ‘console_scripts’, ‘pip3’)()
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python3/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python3/dist-packages/pip/init.py”, line 74, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File “/usr/lib/python3/dist-packages/pip/vcs/mercurial.py”, line 9, in
from pip.download import path_to_url
File “/usr/lib/python3/dist-packages/pip/download.py”, line 25, in
from requests.compat import IncompleteRead
ImportError: cannot import name 'IncompleteRead’
Python 3 library install failed!
If problems persist, visit forums.pimoroni.com for support
pi@raspberrypi:~ $

Thanks for help,
Radek


#2

[quote=“radeksulc, post:1, topic:3321”]
cannot import name ‘IncompleteRead’[/quote]
this issue is typical of an outdated requests module. Try:

sudo pip3 uninstall requests 
sudo apt-get install python3-requests

#3

incidentally when you say ‘updated’ Raspbian, what do you mean?

… python3-smbus should be installed by default, so it looks like you are using Python 3.5… you haven’t switched the distribution to stretch/sid (unstable) in your apt sources list file, or ran rpi-update have you?


#4

I have installed Rasbian yesterday from https://www.raspberrypi.org/downloads/raspbian/.
Then tried to install the library with the same result.
Then sudo apt-get update, sudo apt-get dist-upgrade

Nothing else. I am not much in Python, sorry.

Current result:

pi@raspberrypi:~ sudo pip3 uninstall requests Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load ['__name__']) File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in <module> from requests.compat import IncompleteRead ImportError: cannot import name 'IncompleteRead' pi@raspberrypi:~ sudo apt-get install python3-requests
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3-requests is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
pi@raspberrypi:~ $


#5

[quote=“radeksulc, post:4, topic:3321”]
sudo apt-get dist-upgrade[/quote]
this should have no consequence, but I don’t recommend doing a dist-upgrade unless you have to (i.e you know why you need that command as opposed to apt-get upgrade)

what do you get if you type:

`python3 --version`

#6

I’ve reviewed the script and I don’t think the issue is your python3 version, but pip3 is broken on your system somehow.

It seems I also misremembered the issue and the opposite is true, that is it’s likely your version of the requests module is too new, breaking compatibility with pip 1.5.6 (what ships with Raspbian).

I would have to guess that that came about through install of the requests module using pip3 as some point.

… you can check the result of my ‘detective work’ in the following topic:

http://forums.pimoroni.com/t/issue-installing-blinkt/3207

I would have to stick to my non-commital stance expressed there and probably advise that you start fresh by reimaging Raspbian and don’t permorm a dist-upgrade nor run any commands that pip install requests

… none of our one-line installers would do that, so running curl -sS https://get.pimoroni.com/explorerhat | bash should work.


#7

First of all I need to apologize. There was one more step I performed, forgot and did not mention in my previous communication . It was this step “sudo pip install Flask” as part of installation of https://github.com/sandyjmacdonald/sts_pi_controller which I started before installation of https://github.com/pimoroni/explorer-hat.

Now the lib is installed and test.py works perfectly. Also the STS-PI controller works. I did not run “sudo pip install Flask” at all. As before - I am not much in Python yet so not able what was the negative effect of this command. Anyway.

Thank you for your cool support and immediate responses.
Radek