I just purchased a Pi 2, and every time I use import RPi.GPIO in Python it returns an error that says RPi.GPIO can only be run on a Raspberry Pi, but I am running it on a Pi. I tried apt-get update and apt-get upgrade, but it still doesn't recognize the Pi. What can I do about this?
Asked
Active
Viewed 144 times
2
toyota Supra
- 560
- 2
- 6
- 9
Geoff
- 29
- 1
-
1Is this a fresh install or did you copy the SD card from another Pi. Did you install RPi.GPIO yourself or did you use a pre-installed version? – joan Mar 10 '15 at 19:48
-
Did you custom compile a kernel? What version of RPI.GPIOS are you running. See this http://sourceforge.net/p/raspberry-gpio-python/tickets/84/ for more info. I believe this will fix the problem sudo apt-get update $ sudo apt-get install python-rpi.gpio python3-rpi.gpio – Steve Robillard Mar 10 '15 at 20:33
1 Answers
1
The library had to be updated for raspberry 2 boards - I believe it is documented in "issue 95" which is listed on site : https://pypi.python.org/pypi/RPi.GPIO see also this forum post on raspberry site : http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=99281
monojohnny
- 569
- 1
- 6
- 17