I have just purchased pico display hat. Loaded the Pimoroni uf2 file, but get ImportError: no module named ‘board’ when trying to run examples.
Next followed Adafruit Blinka installation using virtual environment. In the env - loading python3 and then ‘import board’ - no apparent problem.
However in Thonny - import board gives ImportError: no module named ‘board’
Tried installing board module from Adafruit and installing .tar file using manage packages - but this fails ‘http://127.0.0.1:36628’]’ returned non-zero exit status 2
I loaded Adafruit’s uf2 and imported board module without a problem - but sadly the other modules needed for pico display are missing. Tried to load them onto the Adafruit uf2 but again managing packages gives ‘http://127.0.0.1:36628’]’ returned non-zero exit status 2
@alan2 Just to make things a bit clearer: you cannot run Adafruit CircuitPython examples on Pimoroni MicroPython. If you want to run similar/identical code from a venv on a PC/laptop/Pi (using Blinka) and from your Pico, you have to go a different route.
Either you install CircuitPython on your Pico and use CircuitPython examples. The Pico Display Pack is very well supported from CircuitPython side. I use it for example for a simple web-radio:
The other option you have is to install Blinka not in a venv, but on top of MicroPython. This will give you modules like the missing board-module. But I would not recommend this approach, since this adds an additional software-layer and this will always make tracking down errors more difficult.
Thanks for this clear explanation - as is often the case, things are not quite as they seem!
I was trying to make a simple Tetris game for my granddaughter, following an example with pico display. Now it seems that I can’t even get an example prog to work, and am wondering if Thonny is misbehaving? I’m working with a Raspberry Pi 500, if that is relevant
I am not a Thonny user, but I think there is somewhere an option to tell Thonny start the program on the Pico, and not on the Pi500. And judging from your error-message, the latter is the case. PicoGraphics is only available on the Pico, and not on the Pi500, so this would explain the problem.
in Thonny you need to set the Interpreter. For me, on my Windows PC, I launch Thonny, then click the lower right hand corner, and select, MicroPython(Raspberry Pi Pico)
This gets me
MicroPython v1.25.0, pico v1.25.0 on 2025-05-12; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>