adafruit / Adafruit_CircuitPython_RGB_Display

Drivers for RGB displays for Adafruit CircuitPython.
MIT License
133 stars 52 forks source link

ModuleNotFoundError: No module named 'RPi._GPIO' #103

Closed zoobot closed 2 years ago

zoobot commented 2 years ago

Hi I am getting this GPIO error when trying to setup a pitft 240x240. I am trying to install on a pi zero docker with python 3.6, 3.7, 3.8 so far.

Can you tell me what versions of linux and python work with this PiTFT? I've tried all this stuff: https://stackoverflow.com/questions/70697888/rpi-gpio-modulenotfounderror-no-module-named-rpi-gpio

Am I missing something? Thanks for any help!!! Here's all the stuff getting installed:

RUN apt-get update && apt-get install build-essential \
  apt-utils \
  fonts-dejavu \ 
  python3-dev \
  python3-rpi.gpio

RUN pip3 install adafruit-circuitpython-rgb-display RPi.GPIO
RUN pip3 install --upgrade --force-reinstall spidev
Logs]    [4/9/2022, 4:43:15 AM] [main]   File "rgb_display_minipitfttest.py", line 4, in <module>
[Logs]    [4/9/2022, 4:43:15 AM] [main]     import digitalio
[Logs]    [4/9/2022, 4:43:15 AM] [main]   File "/usr/local/lib/python3.8/site-packages/digitalio.py", line 18, in <module>
[Logs]    [4/9/2022, 4:43:15 AM] [main]     from adafruit_blinka.microcontroller.bcm283x.pin import Pin
[Logs]    [4/9/2022, 4:43:15 AM] [main]   File "/usr/local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pin.py", line 5, in <module>
[Logs]    [4/9/2022, 4:43:15 AM] [main]     from RPi import GPIO
[Logs]    [4/9/2022, 4:43:15 AM] [main]   File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
[Logs]    [4/9/2022, 4:43:15 AM] [main]     from RPi._GPIO import *
[Logs]    [4/9/2022, 4:43:15 AM] [main] ModuleNotFoundError: No module named 'RPi._GPIO'

Thanks!!

makermelissa commented 2 years ago

For Blinka, we require a minimum of Python 3.7, but higher versions should also work. You said you're installing this in a docker container?

zoobot commented 2 years ago

Yes, I tried it with ubuntu and debian base images and a bunch of different python versions. I think at one point I got it to show some lines on the screen but got no further with it. Do you have a dockerfile example I could follow for it?

makermelissa commented 2 years ago

Unfortunately I've not used Docker, so I don't have any examples. It sounds like you may not have the latest RPi.GPIO installed because that's where it's failing or perhaps RPi.GPIO is having trouble running in docker. See https://pypi.org/project/RPi.GPIO/.

makermelissa commented 2 years ago

Closing because the issue is not with this library.