Jump to content
Sign in to follow this  

can't access GPIO with python periphery library

Recommended Posts

Hi I am new to this forum. I am trying to use python-periphery library to use the pins  on the board.

if I do :

from periphery import GPIO

gpio3 = GPIO(3,"in")

I get the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/periphery/gpio.py", line 1017, in _open
    with open("/sys/class/gpio/export", "w") as f_export:
PermissionError: [Errno 13] Permission denied: '/sys/class/gpio/export'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linaro/Desktop/temp_hum.py", line 7, in <module>
    gpio3 = GPIO(3,"in")
  File "/usr/local/lib/python3.7/dist-packages/periphery/gpio.py", line 999, in __init__
    self._open(line, direction)
  File "/usr/local/lib/python3.7/dist-packages/periphery/gpio.py", line 1020, in _open
    raise GPIOError(e.errno, "Exporting GPIO: " + e.strerror)
periphery.gpio.GPIOError: [Errno 13] Exporting GPIO: Permission denied


Any Idea how to solve this?



Edited by shenouda

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...