I'm trying to run some old code from gaussian filter when I find out that python launcher gets stuck trying to do the imshow function. I tried:
Used Matplotlib to display a graph to see if the python launcher was the problem but no, graph showed up fine.
Remove process in between just to have the image read and display in fear that something in my code was breaking the launcher but no success.
Reinstalled opencv-python but no success.
Also saw one question like this in the google search but OP deleted it.
Has anyone encounter this issue or has any fix for this?
Example code:
import cv2 as cv
filename = 'chessboard.png'
img = cv.imread(filename)
cv.imshow('dst',img)
cv.waitKey(0)
OS: MacOS Big Sur (11.0.1)
I also encounter this problem when I upgraded to Big Sur.
Uninstall anaconda(every package), and reinstall python.
pip install opencv-python opencv-python-headless
This does help me with imshow() but I can't run cv.face. This attribute is not found.
This solve my problem
pip install --force-reinstall opencv-contrib-python==4.1.2.30
This downgrade gets my code working again.
I resolved the issue with below steps:
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
pip install opencv-python opencv-python-headless
I was also facing the same problem. I solved it by just installing opencv-python-headless
. use:
pip install opencv-python-headless
I also ran into this problem after installing macOS Big Sur. It was not only cv2.imshow()
that did not respond but also cv2.namedWindow()
cv2.imread()
was working however.
Solution was to install opencv-python-headless
as others have said before
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With