Ask Your Question

Revision history [back]

Permission denied when importing neopixel through opencv 3.1.0

Hi I installed neopixel libraries using adafruit on my RPi 3 using the following link http://frederickvandenbosch.be/?p=1014

With this neopixels work perfectly fine without importing cv2 as neopixel require you to be the root user to access gpio ports and /dev/mem.

But, on combining this code with my code that imports cv2, I am unable to import it. Since opencv cannot work as a root user. Now, the problem being neopixel requires a root user access while opencv does not.

On executing my code without sudo, (python sample.py )I get Can't open /dev/mem: Permission denied

while on executing is with sudo (sudo python example.py) I get ImportError: No module names cv2

Please give me suggestions on how this issue be solved.