raspberry picamera

5 views
Skip to first unread message

Yiuri Garino

unread,
Apr 1, 2020, 11:30:44 AM4/1/20
to spyder
Just started to use the python picamera library on Raspberry.

The following simple script can be run only once, the second time it gives the error:

PiCameraMMALError: Failed to enable connection: Out of resources

Just closing Spyder and opening it again let you to run it (once) again.

It seems that Spyder is not correctly closing the camera, am I right ?
Any idea ?

from picamera import PiCamera
from time import sleep

camera = PiCamera()

camera.start_preview()
sleep(5)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
Reply all
Reply to author
Forward
0 new messages