Hi,
i have a question relating to piano hat. I 've just put a new rpi installation with the newest jessie. Put piano hat, enabled i2c, but every time I try to run simple-piano.py I get an error: This script requires the pygame module Install with: sudo pip install pygame
When I try to install pygame I got :
Looking in indexes: Simple index, piwheels - Simple index
Requirement already satisfied: pygame in /usr/lib/python3/dist-packages (1.9.6)
so I have pygame for python3… but still cannot run piano hat… can You help me ?
You could try running the example with python3 simple-piano.py to specify that you want to use Python 3? I suspect you might run into other problems using an OS as old as Jessie though.
s/simple-piano.py:38: RuntimeWarning: use mixer: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory
(ImportError: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory)
pygame.mixer.pre_init(44100, -16, 1, 512)
Traceback (most recent call last):
File “/home/michalboryka/Pimoroni/pianohat/examples/simple-piano.py”, line 38, in
pygame.mixer.pre_init(44100, -16, 1, 512)
File “/home/michalboryka/.local/lib/python3.9/site-packages/pygame/init.py”, line 70, in getattr
raise NotImplementedError(missing_msg)
NotImplementedError: mixer module not available (ImportError: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory)