I know this specific GPIO topic has been posted here in the past. However, this particular twist has me really confused
I’m trying to set up a Python service (to handle a front panel push button reboot function…but that’s not the issue).
I’ve used this Python routine before and it functioned very well. On a “new” (whole other story system I attempted to implement it again.
Firstly, I couldn’t get RPi.GPIO to install. I finally figured that out after a million different directions Now if I do a “pip list” RPi.GPIO shows up as the latest version (-0.7.0). Good so far (I think).
In the push button code there is a line to “import RPi.GPIO as GPIO”. However, I keep getting the message:
“ImportError: No module named RPi.GPIO”
Doesn’t make any sense. Could this have something to do with permissions? Something else?
Anyone offer some insight and (yet some more direction to help me get past this?
Appreciate the help. Thx and cheers…
Check python version and packages
Thx for the response Sam.
I’m running Python 2.7.13. Firstly, does that mean RPi.GPIO-0.7.0 isn’t backwards compatible?
If I do a “pip -v” I get
pip 9.0.1 from /usr/lib/python2.7/dist-packages
a “pip check” produces
No broken requirements found.
and a “pip list” shows
Any of this look suspect?
Appreciate the help…
Not sure. Setting this all up in a virtualenv is probably the best way
virtualenv? I did see some postings abt that. That would be something new and different (and odd I’ve had this same py code running just fine under OSMC on another system that I put together abt 2 yrs. ago.
Has something changed with Debian since then (I figure that would be where this “issue” lies)? Or may be OSMC?
I’ll look closer at the virtualenv and see how that might help.
Thx and cheers…
I’m not sure what the issue would be here. If you installed via Pip I believe there is an option to install globally or just for a user. That may be your problem
As usual, I appreciate the support. That solved it.
I reinstalled rpi.gpio using “sudo pip” and now it seems to work as expected (at least, the service started without any errors…yay!!! Still need to confirm the function works…
Thanks, yet again, for your stellar support…cheers…