(With apologies to the original poster for taking over their thread)
Thank you alphanumeric. The first command fixed that problem at least. I think I learned how to persuade python to install modules in v3 now.
The second command all worked too - if I run it again now I’m told that everything is up to date and nothing new is installed.
python3-numpy is already the newest version (1:1.16.2-1).
python3-pil is already the newest version (5.4.1-2+deb10u2).
python3-pip is already the newest version (18.1-5+rpt1).
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4).
python3-spidev is already the newest version (20190221~182651-1).
0 upgraded, 0 newly installed, 0 to remove and 186 not upgraded.
However, I’m still getting errors from the examples, - I suspect it’s another noob mistake, but I haven’t been able to diagnose it. Here’s what I tried:
Running gif.py from Thonny, it prints out a message saying to use it from the command line. So it seems fine from there, just inappropriately called.
Running from the command line I get this:
pi@raspberrypi:~/Pimoroni/240x240screen $ ./gif.py deployrainbows.gif
from: can’t read /var/mail/PIL
./gif.py: line 22: import: command not found
./gif.py: line 23: import: command not found
./gif.py: line 24: import: command not found
./gif.py: line 29: syntax error near unexpected token $'"""\ngif.py - Display a gif on the LCD.\n\nIf you\'re using Breakout Garden, plug the 1.3"'' ./gif.py: line 29:
If you’re using Breakout Garden, plug the 1.3" LCD (SPI)’
I don’t know what the /var/mail/PIL thing is about - there isn’t anything in /var/mail anyway.
I also don’t know what the unexpected token is about. To get the demos, I copy-pasted them from the git webpage, so I might have corrupted them - but it’s not obvious to me how, and it might be a red herring.
The scrolling-text.py demo gives different errors from the command-line vs Thonny.
Thonny reports:
Python 3.7.3 (/usr/bin/python3)
>>> %Run scrolling-text.py
Traceback (most recent call last):
File "/home/pi/Pimoroni/240x240screen/scrolling-text.py", line 17, in <module>
spi_speed_hz=80 * 1000 * 1000
File "/usr/local/lib/python3.7/dist-packages/ST7789/__init__.py", line 124, in __init__
self._spi = spidev.SpiDev(port, cs)
FileNotFoundError: [Errno 2] No such file or directory
I think that’s the SPI module balking at the display initialisation object.
From the command-line I get this instead:
pi@raspberrypi:~/Pimoroni/240x240screen $ ./scrolling-text.py
from: can’t read /var/mail/PIL
from: can’t read /var/mail/PIL
from: can’t read /var/mail/PIL
./scrolling-text.py: line 4: import: command not found
./scrolling-text.py: line 6: import: command not found
./scrolling-text.py: line 9: MESSAGE: command not found
./scrolling-text.py: line 12: syntax error near unexpected token (' ./scrolling-text.py: line 12:
disp = ST7789.ST7789(’
Which is essentially a reprise of the other demo’s errors.
Any advice would be welcome.