ImportError: no module named 'board'

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

Any ideas?

Display Pack, or Display Pack 2?
What model Pico, and what specific uf2 did you use?
These examples? pimoroni-pico/micropython/examples/pico_display at main · pimoroni/pimoroni-pico

Keep in mind that Adafruit uses Circuit python, not Micro Python.

1 Like

Hi

its a pico display Pico Display Pack

and I used this uf2

https://github.com/pimoroni/pimoroni-pico/releases/download/v1.25.0/pico-v1.25.0-pimoroni-micropython.uf2

Thanks for your help

A

Just flashed my spare Pico (RP2040) with the file you linked too.
The balls demo worked OK for me.
pimoroni-pico/micropython/examples/pico_display/balls_demo.py at main · pimoroni/pimoroni-pico

@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.

1 Like

Thanks for replying

This is what I get, when trying to run balls demo - using the same .uf2

soft reboot
Traceback (most recent call last):
File “”, line 5, in
ImportError: no module named ‘picographics’

Is it Thonny that is misbehaving?

A

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

A

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.

Thanks,

you are correct - I did save the balls demo on the pico, and ran from there. The error about not finding ‘picographics’ happened.

A

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.

>>> 

It connects to my Pico via com port through USB.

This might help
Getting Started with Raspberry Pi Pico

Thanks All,

I reset everything. Loaded .uf2 again. Downloaded balls_demo.py and finally it works.

A

1 Like