First of all, thank you for this great library!
Trying to run the webcam example on my mac using command python webcam_recongnition.py.
keep getting this error on command line
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.
I tried to install mac version of PT platform but the command gave me an error about 'more than 1 binary'.
any advise would be much appreciated!
resolved. If you are on a mac, make sure you install opencv-python-headless instead of opencv-python to avoid these errors.
Faced the same issue on a fresh installation running macOS Catalina 10.15.3, Python 3.7.3. Your solution resolved this for me.
Many thanks!
There are four different packages and you should select only one of them. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (cv2). If you installed multiple different packages in the same environment, uninstall them all with pip uninstall and reinstall only one package.
a. Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
run
pip install opencv-pythonif you need only main modules
runpip install opencv-contrib-pythonif you need both main and contrib modules (check extra modules listing from OpenCV documentation)b. Packages for server (headless) environments
These packages do not contain any GUI functionality. They are smaller and suitable for more restricted environments.
run
pip install opencv-python-headlessif you need only main modules
runpip install opencv-contrib-python-headlessif you need both main and contrib modules (check extra modules listing from OpenCV documentation)
Quotes from https://pypi.org/project/opencv-python-headless/
same issue on a macOS Catalina 10.15.3, Python 3.7.6. After a week looking for the solution in the internet, finally I found your solution and hopefully that works for me too.
Thanksssssss!
resolved. If you are on a mac, make sure you install
opencv-python-headlessinstead ofopencv-pythonto avoid these errors.
I am using Mac. I also faced the same problem. Your solution worked perfectly in my Mac.
Thanks @pacjin79, installing opencv-python-headless worked.
Thank u, I guess it's broken on catalina for now. The red close button doesn't show up either, I vb Ubuntu and everything was working perfectly.
@pacjin79 you are a savior of humankind !!
@pacjin79 you have saved my work and sanity. Now back up and running thank you
I do not understand why, but I only got this message on my MacBook Pro but not on the IMac running the same version of Mac OS Catalina (10.15.3). After changing the installation with opencv-contrib-python-headless, it works fine on the MacBook Pro. Many Thanks for the solution.
you all should not install 'opencv-contrib-python-headless' package because this is for server.
Opening the window with cv2.imshow does not seem to be a problem, but the closing button does not work.
So, you should install previous version.
pip3 install --user opencv-contrib-python==4.1.2.30
The close button does work well.
This is a bug in opencv 4.2.0.32.
Today (2020-04-04) opencv 4.2.0.34 became available, which resolves this issue.
Uninstall the old opencv version:
pip3 uninstall opencv-python
pip3 uninstall opencv-contrib-python
Install the new opencv 4.2.0.34:
pip3 install opencv-contrib-python==4.2.0.34
No need to use a headless version (unless you want to for other reasons).
On a side note:
I'm on MacOS Mojave (10.14.5 (18F132)), and if I run from within PyCharm, cv2.destroyAllWindows() is not able to close the image window.
Works just fine though if I run from the MacOS terminal (bash). Must be PyCharm causing a problem with cv2 windows.
This is a bug in opencv 4.2.0.32.
Today (2020-04-04) opencv 4.2.0.34 became available, which resolves this issue.
Uninstall the old opencv version:
pip3 uninstall opencv-python
pip3 uninstall opencv-contrib-pythonInstall the new opencv 4.2.0.34:
pip3 install opencv-contrib-python==4.2.0.34No need to use a headless version (unless you want to for other reasons).
On a side note:
I'm on MacOS Mojave (10.14.5 (18F132)), and if I run from within PyCharm, cv2.destroyAllWindows() is not able to close the image window.
Works just fine though if I run from the MacOS terminal (bash). Must be PyCharm causing a problem with cv2 windows.
This worked for me. Thanks.
Great thanks guys
Most helpful comment
resolved. If you are on a mac, make sure you install
opencv-python-headlessinstead ofopencv-pythonto avoid these errors.