conditions | Contents |
---|---|
OS | macOS Catalina 10.15.6 |
python environment | pyenv + Anaconda2020-02[^1] |
- Pyqt5 | 5.15.0 |
- opencv-python | 4.2.0.32 |
ʻWhen I ran a program that uses opencv-python and
PyQt5` at the same time, it quits with a lengthy error message.
objc[54311]: ClassQMacAutoReleasePoolTracker is implemented in bot /Users/hogehoge/opt/anaconda3/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (fugafuga) and /Users/hogehoge/opt/anaconda3/lib/python3.7/site-packages/cv2/.dylibs/QtCore (fugafuga). One of the two will be used. Which one is undefined.
objc[54311]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE (Same as above).
objc[54311]: Class KeyValueObserver (Same as above).
objc[54311]: Class RunLoopModeTracker (Same as above).
(Omission)
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.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "/Users/hogehoge/opt/anaconda3/lib/python3.7/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: cocoa, minimal, offscreen, webgl.
I almost gave up with this amount of messages. But I couldn't help doing it.
Reference: https://qiita.com/dragonemox/items/2d17db7620979711d65c
Put it back in for the time being. (I wonder why I put it in recently)
pip uninstall pyqt5
pip install pyqt5
If this doesn't work (though you can't really do it)
pip uninstall pyqt5
conda install pyqt
The cause remains unknown.
QT_PLUGIN_PATH
? You can only find the path by looking at the library hierarchy.Stop using Anaconda on your mac.
[^ 1]: Same for miniconda3-latest
Recommended Posts