User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: import RPi.GPIO as GPIO RuntimeError

Fri Feb 20, 2015 10:02 pm

Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.

Thanks for the great work on this!
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: import RPi.GPIO as GPIO RuntimeError

Fri Feb 20, 2015 10:13 pm

meltwater wrote:Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.
It's been there for a couple of days now...

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: import RPi.GPIO as GPIO RuntimeError

Fri Feb 20, 2015 11:37 pm

DirkS wrote:
meltwater wrote:Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.
It's been there for a couple of days now...
That's good news...chances are it went live, just after I last checked! :)
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

Houtkamp
Posts: 8
Joined: Wed Dec 18, 2013 6:50 pm

Re: import RPi.GPIO as GPIO RuntimeError

Fri Mar 06, 2015 6:59 pm

Has anyone figured out a way to use GPIO yet, or is it still messed up?

It would be great to be able to use this feature...

Bill

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: import RPi.GPIO as GPIO RuntimeError

Fri Mar 06, 2015 7:20 pm

Houtkamp wrote:Has anyone figured out a way to use GPIO yet, or is it still messed up?

It would be great to be able to use this feature...

Bill
Which feature?
AFAIK updated RPi.GPIO has been fixed *and* in the repo for about 2 weeks now.
If you still have problems you should report them athttp://sourceforge.net/p/raspberry-gpio-python/tickets/

User avatar
DougieLawson
Posts: 35831
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: import RPi.GPIO as GPIO RuntimeError

Fri Mar 06, 2015 7:49 pm

sudo apt-get update && sudo apt-get upgrade
Will get the latest RPi.GPIO library.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

netelbcn
Posts: 5
Joined: Wed Jan 01, 2014 11:24 pm

Re: import RPi.GPIO as GPIO RuntimeError

Sun Mar 08, 2015 9:13 pm

Hi,

I'm trying to import the RPi.GPIO library, and I have the same error message however I hsve the RPi.GPIO-0.5.11.egg version.

Could you help to me in order to solve this issue?

Thanks!

texy
Forum Moderator
Forum Moderator
Posts: 5155
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: import RPi.GPIO as GPIO RuntimeError

Sun Mar 08, 2015 9:29 pm

netelbcn wrote:Hi,

I'm trying to import the RPi.GPIO library, and I have the same error message however I hsve the RPi.GPIO-0.5.11.egg version.

Could you help to me in order to solve this issue?

Thanks!
....see Dougie's post above.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

netelbcn
Posts: 5
Joined: Wed Jan 01, 2014 11:24 pm

Re: import RPi.GPIO as GPIO RuntimeError

Mon Mar 09, 2015 9:34 am

texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!

texy
Forum Moderator
Forum Moderator
Posts: 5155
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: import RPi.GPIO as GPIO RuntimeError

Mon Mar 09, 2015 9:40 am

netelbcn wrote:texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!
Please can you post the error message.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
DougieLawson
Posts: 35831
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: import RPi.GPIO as GPIO RuntimeError

Mon Mar 09, 2015 9:48 am

Uninstall the version that dpkg/apt-get knows about.
sudo apt-get purge python{,3}-rpi.gpio

Scan your filesystem for all copies of RPi.GPIO
find /usr -name "*RPi*"
remove everything that you find

sudo apt-get install python{,3}-rpi.gpio
to put back a good version.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

hayderOICO
Posts: 49
Joined: Thu May 09, 2013 3:40 pm

Re: import RPi.GPIO as GPIO RuntimeError

Mon Mar 09, 2015 12:17 pm

netelbcn wrote:texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!
I believe you may still have the old versions lurking about in your usr/local/lib/python* find and delete them!

netelbcn
Posts: 5
Joined: Wed Jan 01, 2014 11:24 pm

Re: import RPi.GPIO as GPIO RuntimeError

Tue Mar 10, 2015 11:12 am

DougieLawson wrote:Uninstall the version that dpkg/apt-get knows about.
sudo apt-get purge python{,3}-rpi.gpio

Scan your filesystem for all copies of RPi.GPIO
find /usr -name "*RPi*"
remove everything that you find

sudo apt-get install python{,3}-rpi.gpio
to put back a good version.
I followed these steps, and now it works fine!

Thanks a lot!!

Liam Senior
Posts: 4
Joined: Fri Jun 05, 2015 6:28 am

Re: import RPi.GPIO as GPIO RuntimeError

Fri Jun 05, 2015 6:42 am

Hi all, i have a Pi2 and i am still getting the

Code: Select all

    import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!
error despite following the fix mentioned above. Help?

-many thanks

texy
Forum Moderator
Forum Moderator
Posts: 5155
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: import RPi.GPIO as GPIO RuntimeError

Fri Jun 05, 2015 11:59 am

Liam Senior wrote:Hi all, i have a Pi2 and i am still getting the

Code: Select all

    import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!
error despite following the fix mentioned above. Help?

-many thanks
Which os are you using, and how old is it?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
DougieLawson
Posts: 35831
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: import RPi.GPIO as GPIO RuntimeError

Fri Jun 05, 2015 4:59 pm

What do you get from

Code: Select all

#!/usr/bin/python
import RPi.GPIO
print RPi.GPIO.VERSION
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Liam Senior
Posts: 4
Joined: Fri Jun 05, 2015 6:28 am

Re: import RPi.GPIO as GPIO RuntimeError

Sat Jun 06, 2015 6:11 am

OS is raspbian (05-05), RPi.GPIO is 0.5.11, I have python.dev installed if that makes a difference

-many thanks

User avatar
DougieLawson
Posts: 35831
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: import RPi.GPIO as GPIO RuntimeError

Sat Jun 06, 2015 9:22 am

You've got an old version of RPi.GPIO hiding in the bowels of your filesystem.

sudo apt-get purge python{,3}-rpi.gpio
find . -name "*RPi.GPIO*" | xargs sudo rm
sudo apt-get install python{,3}-rpi.gpio
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Liam Senior
Posts: 4
Joined: Fri Jun 05, 2015 6:28 am

Re: import RPi.GPIO as GPIO RuntimeError

Mon Jun 08, 2015 2:37 am

DougieLawson wrote:You've got an old version of RPi.GPIO hiding in the bowels of your filesystem.

sudo apt-get purge python{,3}-rpi.gpio
find . -name "*RPi.GPIO*" | xargs sudo rm
sudo apt-get install python{,3}-rpi.gpio
Tried it several times with no luck, program still not running

-many thanks

User avatar
joan
Posts: 14198
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: import RPi.GPIO as GPIO RuntimeError

Mon Jun 08, 2015 7:37 am

Is device tree enabled?

grep device /boot/config.txt

Liam Senior
Posts: 4
Joined: Fri Jun 05, 2015 6:28 am

Re: import RPi.GPIO as GPIO RuntimeError

Tue Jun 09, 2015 6:06 am

joan wrote:Is device tree enabled?

grep device /boot/config.txt
Tried with both enabled and disabled, no luck

-many thanks

User avatar
DougieLawson
Posts: 35831
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: import RPi.GPIO as GPIO RuntimeError

Tue Jun 09, 2015 7:28 am

Liam Senior wrote:
joan wrote:Is device tree enabled?

grep device /boot/config.txt
Tried with both enabled and disabled, no luck

-many thanks
Are you looking at the right config.txt? If using NOOBS boot the system while holding the [SHIFT] key to get the NOOBS recovery system running, it has a config editor.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joan
Posts: 14198
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: import RPi.GPIO as GPIO RuntimeError

Tue Jun 09, 2015 7:34 am

Liam Senior wrote: ...
Tried with both enabled and disabled, no luck
...
It does not resolve your issue but you need to enable device tree for recent versions of RPi.GPIO. It is broken on non device tree systems.

Return to “Python”