Skip to main content
added 542 characters in body
Source Link
JoeyCK
  • 708
  • 1
  • 5
  • 10

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.56.110a3

With sudo everythingHere is the code:

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
print "LED on"
GPIO.output(18,GPIO.HIGH)
time.sleep(1)
print "LED off"
GPIO.output(18,GPIO.LOW)

And the full error:

pi@raspberrypi ~/Desktop/python $ python ./sensors.py
Traceback (most recent call last):
  File "./sensors.py", line 5, in <module>
    GPIO.setup(18,GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!

When I run it as root it works correctly.

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.6.0a3

Here is the code:

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
print "LED on"
GPIO.output(18,GPIO.HIGH)
time.sleep(1)
print "LED off"
GPIO.output(18,GPIO.LOW)

And the full error:

pi@raspberrypi ~/Desktop/python $ python ./sensors.py
Traceback (most recent call last):
  File "./sensors.py", line 5, in <module>
    GPIO.setup(18,GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!

When I run it as root it works.

Tweeted twitter.com/StackRaspi/status/681339877389144064
deleted 13 characters in body
Source Link
Steve Robillard
  • 34.9k
  • 18
  • 104
  • 109

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

Thank you

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

Thank you

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

added 40 characters in body
Source Link
JoeyCK
  • 708
  • 1
  • 5
  • 10

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

Thank you

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

Thank you

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py":

No access to /dev/mem. Try running as root!

I've read in many places that you no longer need root with the latest version of the library but I still get the error after updating. The version I have is RPi.GPIO 0.5.11

With sudo everything works correctly

Thank you

Source Link
JoeyCK
  • 708
  • 1
  • 5
  • 10
Loading