Inky pHAT examples won't run

Following the tutorial https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat

On Raspian GNU/Linux 8

Cloned the GitHub repo https://github.com/pimoroni/inky

The name-badge.py example gives me

ImportError: This library requires the smbus2 module

If I do the recommended sudo pip install smbus2 I get

ImportError: No module named _internal.cli.main

Tried sudo pip3 install smbus2 and I got

… error in smbus2 setup command: ‘extras_require’ must be a dictionary

Also tried sudo pip3 install smbus2==‘0.3.0’ and I got the same error.

Any ideas?

Also tried the direct curl install

curl https://get.pimoroni.com/inky | bash

for which I had to add the -k flag since the https certificate has expired.

Get the following errors for each package:

File "/usr/local/bin/pip2", line 7, in <module>
    from pip._internal.cli.main import main
ImportError: No module named _internal.cli.main
Unable to install RPi.GPIO for python2!

File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
ImportError: No module named pip_internal
Unable to install RPi.GPIO for python3!

Looks like my pip is corrupted, so I tried reinstalling pip

sudo apt purge python-pip python3-pip -y
sudo apt install python-pip python3-pip -y

and I get the same errors. Any ideas?

Also thought this might help, to get pip to stop complaining

This seemed to work

sudo easy_install pip

Then tried the curl with a bit more success, seemed to run through and install stuff (took ages)

Tried to run the name badge example again and it still complained about smbus2

sudo pip install smbu2

and get

error in smbus2 setup command: 'extras_require' must be a dictionary...

Honestly, python version/package management could easily drive you insane…

Would really really appreciate some help on this, I’ve got a pHAT and a wHAT just waiting to go!

SOLVED
For anyone else that ends up here, this is what eventually worked for me:

  • Install the latest Rasbian. Install script then ran through successfully.
  • Turn on i2c via raspi-config and reboot
  • Make sure the Inky pHAT is pushed down really firmly

Hoorah! Now I can make something cool!