I get an internal server error when I import the gpio pins library in my simple __init__.py file. And the debugger doesn't show up. As I understand it, the server doesn't have the permission to access the gpio pins. How do I give it permission?

  • What library are you using to access the GPIO pins? If it's RPi.GPIO (and it's a recent version) then the user running the script needs to be a member of the gpio group (the pi user is by default)
    – Dave Jones
    Sep 1, 2016 at 20:17

1 Answer 1


If you are trying to access the GPIO pins and trigger the pins from a web UI (http request). I would suggest you to keep a utility directory (lib) in your flask project and write your triggers/actions for GPIO pins there.

Keep it away from your flask application.Based on your request (ReST API request) have this utility module imported on the corresponding file and then introduce your trigger to the pin.

Let me know if this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.