Import RPi error

Forum announcements

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
pucomponent
 
Posts: 13
Joined: Sat Dec 07, 2013 2:52 am

Import RPi error

Post by pucomponent »

Dear officer

I tried to config GPIO by following lesson 4 gpio setup step by step.
It was success with out any error.
***But when i was try to do the following command.....
import RPi.GPIO as GPIO
***It show error message
Traceback (most recent call last):
File "<stdin>",line 1,in <module>
RPi.GPIO.SetupException: No access to /dev/mem. Try running as root!

***How to fix that

Regards
P.U.COMPONENT

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Import RPi error

Post by adafruit_support_mike »

Use the `sudo` command to run the script. That will allow it to use the GPIO pins.

pucomponent
 
Posts: 13
Joined: Sat Dec 07, 2013 2:52 am

Re: Import RPi error

Post by pucomponent »

I got it...
Thanks
:-)

Locked
Please be positive and constructive with your questions and comments.

Return to “Announcements”