-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: No module named _GPIO #1
Comments
I am having the same problem. I have a regular upboard running ubuntu 16.04. I followed the instruction here: https://wiki.up-community.org/Ubuntu to install ubuntu. |
I solved this by changing the line "from RPi._GPIO import *" in RPi/GPIO/init.py to "from .._GPIO import *" |
@jennyshane had the correct idea. A simple update of Tested on Python 3.7.2 - Raspberry Pi Debian |
I've had the same issue, the problem was that i was installing rpi.gpio using
trying to install RPi.Gpio without build-essential throws error that it's missing gcc. |
Still not working (on Ubuntu 20.04 for RPi). I've tried all the suggestions here, and still get: |
Manjaro arm new: installed rpi-gpio and gpiozero with pacman but it installs rpi-gpio into an empty python3.8 folder, gpiozero installs into python3.9. The contents of the rpi-gpio is just init.py and a few other files. Init.py imports from _GPIO which does not exist. I think there is an install issue with Manjaro and pacman. |
This gets past the module not found error (using Python3.10.2), but doesn't actually load the module (which, I'm assuming) are the .so files in the directory that start with _GPIO…) |
Loaded latest Raspberry Pi Debian 32 bit full onto Pi Zero clean install (Python 3.9 default) |
In my case, where I am trying to get all of this running in a standalone copy of Jython, to call inside of Java, you need to build the RPi.GPIO package first. Using the following command in the root RPI.GPIO folder:
Once you build it, it will produce a .egg file inside of the dist file, unzip this with any normal Linux/Mac/Windows archiver and then you will have the _GPIO.py file inside of the root RPi file (inside that .egg). Once I did that, then this all worked. Before that, I had the same issues as you all and I'm not sure just changing _GPIO to GPIO is the right fix here (at least, if you want a fully standalone copy to run this). Note: You need to build the package on the system you intend to deploy it on, or else you'll end up with a x86 copy on your RPi (which is ARM of course). Best of luck! |
I have had the same issue when using the RPi.GPIO library in two identical containers one deployed on a Raspberry 1 and the other in a Raspberry 2, based on python 3.10, where the library was installed via pip install. The one in the Raspberry 2 worked fine, while the one in the Rasberry 1 did not. After a long investigation I came to the conclusion that the culprit is the precompiled RPI._GPIO, which does not load/work correctly for the Raspi 1 architecture.
|
Hi emutex,
I built RPi.GPIO from your repository and followed INSTALL.TXT on my Intel UP board. When I tried to import RPi.GPIO, python (2.7) returns:
"""
File "RPi/GPIO/init.py", line 23, in
from RPi._GPIO import *
ImportError: No module named _GPIO
"""
Please let me know if there is something else I need to look out for during the installation process.
Thank you!
The text was updated successfully, but these errors were encountered: