# Rafael Kit Led Matrix project

**URL:** <https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843>\
**Category:** Learning kit for Raspberry Pi\
**Created:** [September 27, 2025, 1:21pm UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843 "2025-09-27T13:21:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![astroman133](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@astroman133](https://forum.sunfounder.com/u/astroman133)\
**Post date:** [September 27, 2025, 1:21pm UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/1 "2025-09-27T13:21:22Z")

</div>

Working my way through the Raphael kit on a new Raspberry Pi 5. Currently doing the 1.1.6\_LedMatrix project with Python. Following the instructions after building the circuit, I did the software installation and created the virtual environment and activated it. When i run the script for the project I am unable to import from the luma.core.interface.serial package. I can look in the venv and see it, but Python can’t, apparently. I am an experienced developer but pretty new to the Pi and Linux and I need some help.

The error is

File “/home/rick/raphael-kit/python-pi5/1.1.6\_LedMatrix.py”, line 1, in  
from luma.core.interface.serial import sp1, noop  
ModuleNotFoundError: No module named ‘luma’

Thanks!

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 28, 2025, 3:51am UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/3 "2025-09-28T03:51:37Z")

</div>

1. Have you enabled the SPI service before running the example code?  
Please execute the `sudo raspi-config` command to enable SPI. You can follow the instructions in this tutorial link:  
[SPI Configuration](https://docs.sunfounder.com/projects/raphael-kit/en/latest/appendix/spi_configuration.html#spi-configuration)

2. Have you installed the Luma.LED\_Matrix module before running the code?  
Please install it by following the instructions in this tutorial link:  
[Install the Libraries](https://docs.sunfounder.com/projects/raphael-kit/en/latest/appendix/install_the_libraries.html#luma-led-matrix)

Once you have completed these two steps, please run the 1.1.6\_LedMatrix project and check how it works.

---

<div class="post-metadata">

**Author:** ![astroman133](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@astroman133](https://forum.sunfounder.com/u/astroman133)\
**Post date:** [September 28, 2025, 12:45pm UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/4 "2025-09-28T12:45:46Z")

</div>

As I said. I followed the instructions, so yes I enabled SPI and installed the Luma.LED\_Matrix module before running the code. The error message is from running the code after completing those steps.

My next step, later today, is to delete the venv and do the software installation again.

Thanks!

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 29, 2025, 7:06am UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/5 "2025-09-29T07:06:33Z")

</div>

We have verified the tutorial, and it works correctly.

Please note the following:

In Step 1 of installing the Luma.LED\_Matrix module, when running sudo usermod -a -G spi,gpio pi, replace “pi” with your own username instead of copying the command directly.

For example, if your username is “only”, run:  
sudo usermod -a -G spi,gpio only

Then continue with the tutorial steps.

After completing all instructions for the Luma.LED\_Matrix module, run:  
cd ~/raphael-kit/python-pi5  
sudo ~/my\_env/bin/python3 1.1.6\_LedMatrix.py  
If you see the error:  
ModuleNotFoundError: No module named ‘spidev’

Run this command:  
sudo ~/my\_env/bin/pip3 install spidev

Then run the example 1.1.6\_LedMatrix.py again to check the result.

---

<div class="post-metadata">

**Author:** ![astroman133](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@astroman133](https://forum.sunfounder.com/u/astroman133)\
**Post date:** [September 29, 2025, 1:02pm UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/6 "2025-09-29T13:02:52Z")

</div>

I deleted and re-created the virtual environment and installed spidev in the virtual environment. Then when I ran 1.1.6\_LedMatrix.py it started with no errors. However, I discovered that use of sudo to run the script was unnecessary. I assumed that this was because of the “usermod” command that was executed as part of the installation of the Luma.LED\_Matrix module

Installing spidev in the virtual environment was not a documented step. The SPI configuration changes were made before the virtual environment was created.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 30, 2025, 8:11am UTC](https://forum.sunfounder.com/t/rafael-kit-led-matrix-project/3843/7 "2025-09-30T08:11:58Z")

</div>

We are glad that you resolved the issue.  
You believe that there is no need to run the script with sudo, and you speculate that this is due to the usermod command executed when installing the Luma.LED\_Matrix module (adding the user to the spi and gpio user groups). This speculation is entirely reasonable—spi and gpio are user groups in Raspberry Pi that control hardware interfaces. Once a user is added to these groups, they can access SPI and GPIO resources without administrator privileges (sudo), so there’s no need to use sudo when running the script.

If you rebuild the virtual environment later, we recommend installing the spidev and Luma.LED\_Matrix modules first in the new environment (you can run sudo ~/new\_environment\_path/bin/pip3 install spidev luma.led-matrix) to avoid errors due to missing dependencies.
