0

I'm on macOS Monterey 12.5.1, and I try to execute this code in python with IDLE, to capture my camera video:

import cv2
cap=cv2.VideoCapture(0)

And that returns an error:

OpenCV: not authorized to capture video (status 0), requesting...

Process ended with exit code -9.

I go in System preferences -> Security and privacy -> privacy -> camera I want to enable the camera access for IDLE but the IDLE app doesn't appears in the list of applications, and I can't add any apps.

I don't know how to enable the camera permission for IDLE or how to resolve the problem.

Please help me by telling what to do to resolve this problem ! Thanks.

  • if you run it in the terminal, it should prompt you to agree to use video. Once you click OK, terminal is added to the list of apps. With IDLE, I assume it is the same or a similar experience. – MrE Jun 08 '23 at 19:18
  • Does this answer your question? [OpenCV command line app can't access camera under macOS Mojave](https://stackoverflow.com/questions/56084303/opencv-command-line-app-cant-access-camera-under-macos-mojave) – Christoph Rackwitz Jun 08 '23 at 20:08

0 Answers0