picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resource

raspberry PI camera occupation problem and solution

when using Python and PiCamera to take a photo/video, if

is not in time

camera.close()


When

runs again, an error may occur:

picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resource

solution:

just find and kill the process where the Camera is.

step1: ps -u

find the corresponding python PID, such as 14255

step2: kill 14255

step3: re-run, problem solved

Read More: