ModuleNotFoundError: No module named 'adafruit_rgb_display'

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
bigguyjones
 
Posts: 3
Joined: Thu Nov 25, 2021 2:23 am

ModuleNotFoundError: No module named 'adafruit_rgb_display'

Post by bigguyjones »

I setup pi-hole on a pi zero w and that all works fine and is running properly. i just can't get the screen working yet.

I am NOT using the OLED kit, I'm using the Mini PiTFT.

I'm following the guide for the kit i bought here: https://learn.adafruit.com/pi-hole-ad-b ... w?view=all

when i type the command "sudo python3 ~pi/stats.py" it just returns

Traceback (most recent call last):
File "/home/pi/stats.py", line 16, in
import adafruit_rgb_display.st7789 as st7789
ModuleNotFoundError: No module named 'adafruit_rgb_display'

I assume I must be missing a step but i don't know what.
I would really appreciate the help I am new to the raspberry pi world

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

I am getting the same error. I get color display of booting of the pi hole and all the way up to the prompt. I get the same error when I run the test line "sudo python3 ~pi/stats.py".
I found a thread indicating the need to follow these steps (https://learn.adafruit.com/adafruit-min ... -3044137-7). I had already followed these steps and this is the output that I get with colors.

I have the correct updated stats.py code from the instructions. when I run the test line "sudo python3 ~pi/stats.py"
The error reads:
File "/home/pi/stats.py", line 16, in <module>
import adafruit_rgb_display.st7789 as st7789
ModuleNotFoundError: No module named 'adafruit_rgb_display'

In case its needed, I"m running the following kernel version:
||/ Name Version Architecture Description
+++-==================-==============-============-=================================


ii raspberrypi-kernel 1:1.20211118-3 armhf Raspberry Pi bootloader

***Update I ran the kernel downgrade to the may2021 version and no change...

I would appreciate any assistance. The pi hole runs fine, its just the output to the display when I try to run the pi hole upddate for the pitft does not change nor the buttons work.

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

Did you go through the Python setup?
https://learn.adafruit.com/pi-hole-ad-b ... -3049424-9

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

Yes I did go thru the python setup, but is is possible that I need to redo something at some particular point? I can run thru it again, if it won't cause having to redo another section. I'm open to trying whatever you recommend. I'd like to bring up this display.

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

Try installing the RGB library again:
https://learn.adafruit.com/adafruit-min ... 3044242-12

If it hits any errors, post the details here.

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

Response is "requirement already satisfied" on the first command (pip3 install adafruit-circuitpython-rgb-display).
On running the pi@pi-hole:~ $ pip3 install --upgrade --force-reinstall spidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting spidev
Using cached https://www.piwheels.org/simple/spidev/ ... armv6l.whl (39 kB)
Installing collected packages: spidev
Attempting uninstall: spidev
Found existing installation: spidev 3.5
Uninstalling spidev-3.5:
Successfully uninstalled spidev-3.5
Successfully installed spidev-3.5
I followed all the way down the page to the numpy library install without any errors.
Then when I ran the button test program, it gave the following errors.
python3 rgb_display_minipitfttest.py
Traceback (most recent call last):
File "/home/pi/rgb_display_minipitfttest.py", line 17, in <module>
board.SPI(),
File "/usr/local/lib/python3.9/dist-packages/board.py", line 311, in SPI
return busio.SPI(SCLK, MOSI, MISO)
File "/usr/local/lib/python3.9/dist-packages/busio.py", line 286, in __init__
self._spi = _SPI(portId)
File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 22, in __init__
self._spi = spi.SPI(device=(portid, 0))
File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 167, in __init__
raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist

I went back to the spi install and ran this check:
pi@pi-hole:~ $ ls /dev/i2c* /dev/spi*
/dev/i2c-1 /dev/i2c-2 /dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2

It seems that the 0.0 and 0.1 spi devices are missing? Am I seeing that correctly? How do I correct that, if its the cause?

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

A precursor to Python setup:
https://learn.adafruit.com/adafruit-min ... thon-setup
is to install Blinka:
https://learn.adafruit.com/circuitpytho ... spberry-pi

The Blinka install script should have enabled the SPI ports. Also, after running the script, there's a test to make sure it's all OK:
https://learn.adafruit.com/circuitpytho ... 3030038-18


Did you run the Blinka install script? Did you run the post install test?

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

I had previously (more than once getting the same result). So after your post, I reran this page (https://learn.adafruit.com/circuitpytho ... 3030038-18) and then ran the test line.
Below is the same result:

pi@pi-hole:~ $ python3 blinkatest.py
Hello blinka!
Digital IO ok!
I2C ok!
Traceback (most recent call last):
File "/home/pi/blinkatest.py", line 16, in <module>
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
File "/usr/local/lib/python3.9/dist-packages/busio.py", line 286, in __init__
self._spi = _SPI(portId)
File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 22, in __init__
self._spi = spi.SPI(device=(portid, 0))
File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 167, in __init__
raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist
pi@pi-hole:~ $

I still do not have spidev0.0 or 0.1.
I instead get the following result:
pi@pi-hole:~ $ ls /dev/i2c* /dev/spi*
/dev/i2c-1 /dev/i2c-2 /dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2
And now the display shows the pihole prompt (in color) but its not displaying on all the screen. There appears to be static below and right of the frame being displayed. I know I saw another post somewhere about it not being formatted correctly, but can't find it.

**PS, I appreciate your time. I get home from IT work all night and do this for fun, lol.

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

You got this when you ran the blinka test previously?

Code: Select all

OSError: /dev/spidev0.0 does not exist
Or that's new?

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

That is the current response after going back thru the steps recommended.

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

Try uninstalling this module:
On running the pi@pi-hole:~ $ pip3 install --upgrade --force-reinstall spidev
Where did you see guidance to install that?

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

From this page: https://learn.adafruit.com/adafruit-min ... thon-setup
Followed the instructions for the 1.14.
This to install the RGB library.
See the snip attached.
There are a lot of links to related pieces in the documenttion, hard to discern which rabbit hole to be sure is correct.
Attachments
rgb install snip.png
rgb install snip.png (90.57 KiB) Viewed 1593 times

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

OK, thanks for the link.

Let's go back to the Blinka install and see if we can get the missing SPI ports to at least show up. Try running this:

Code: Select all

sudo python3 -m pip install --upgrade --force-reinstall adafruit-blinka Adafruit-PlatformDetect
as a way to force a reinstall of Blinka and then reboot and see if the Blinka test then passes:
https://learn.adafruit.com/circuitpytho ... 3030038-18

User avatar
Racer1Tn
 
Posts: 53
Joined: Tue Oct 17, 2017 1:53 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by Racer1Tn »

The script fails on running and so does the third step of the Blinka test. I attached the code results.
Looks like the Blinka needs to be reinistalled? And from what point should I start?
Attachments
Script fail.txt
(44.83 KiB) Downloaded 11 times

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: ModuleNotFoundError: No module named 'adafruit_rgb_displ

Post by adafruit_support_carter »

I think you're hitting this:
https://sourceforge.net/p/raspberry-gpi ... ckets/188/
https://sourceforge.net/p/raspberry-gpi ... ckets/198/

So it's a temporary issue. It's been fixed, but not officially released, except in an alpha version. You can try installing the patched version by specifying the release:

Code: Select all

sudo python3 -m pip install RPi.GPIO==0.7.1a4

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”