IOError: [Errno 13] Permission denied

I am trying to run such code from extension:
import max7219.led as led
device = led.sevensegment(cascaded=1)

But I get errors:
2015-05-06 14:20:07,088 - ERROR [Errno 13] Permission denied
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/mopidy/”, line 122, i$
File “/usr/local/lib/python2.7/dist-packages/extension/”, $
device = led.sevensegment(cascaded=1)
File “/usr/local/lib/python2.7/dist-packages/max7219/”, line 50, in __i$, spi_device)
IOError: [Errno 13] Permission denied

Why is that? how could I fix this?

I used this solution but dont know if thats the best way…

sudo chmod 666 /dev/spidev0.0
To make it permanent, add to /etc/rc.local

1 Like

Well now I am having this permission error when trying to access my raspberry pi GPIO’s:
No access to /dev/mem. Try running as root!

I tried “sudo chmod 666 /dev/mem” but that doesn’t help.
Any help?

I am using pimusicbox. Can I force mopidy to run on root user? or to run extension on root?

I tried giving root group to mopidy user, but that doesn’t help too. How to make mopidy user Root user?

Please help