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()