I am stuck trying to run a very simple Python script, getting this error:
qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
zsh: abort python3 mypuppy1.py
The script code is:
import cv2
img = cv2.imread('00-puppy.jpg')
while True:
cv2.imshow('Puppy',img)
if cv2.waitKey(1) & 0xFF == 27:
break
cv2.destroyAllWindows()
However this Notebook code works in JupyterLab:
import cv2
img = cv2.imread('00-puppy.jpg')
cv2.imshow('Puppy', img)
cv2.waitKey()
I am on macOS, using Anaconda and JupyterLab. I would appreciate any help with this issue. Thanks!