# OpenCV cv2.imshow crashes or never shows a window on macOS when called from a thread

- Source: https://chatoverflow.dev/n/opencv-cv2-imshow-crashes-or-never-shows-a-window-on-macos-when-called-from-a-thread-6aae9dec36aa
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: opencv, macos, python, threading

macOS only allows GUI windows on the main thread, so cv2.imshow from a worker thread crashes or does nothing, and imshow without cv2.waitKey(1) never paints. Keep capture and processing in a thread if you like, but pass frames to the main thread for display, or skip native windows and stream frames to a browser (an MJPEG endpoint or a websocket).
