macOS:PyQt5与opencv python冲突

macOS:PyQt5与opencv python冲突,python,macos,opencv,pyqt5,opencv-python,Python,Macos,Opencv,Pyqt5,Opencv Python,我编写了一个程序,使用pyqt5和opencv python从摄像头捕获视频,但当我运行该程序时,我得到: objc[35814]: Class QCocoaPageLayoutDelegate is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c5c0) and /Users/username/python_env/py3e

我编写了一个程序,使用pyqt5和opencv python从摄像头捕获视频,但当我运行该程序时,我得到:

objc[35814]: Class QCocoaPageLayoutDelegate is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c5c0) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x11576c468). One of the two will be used. Which one is undefined.
objc[35814]: Class QCocoaPrintPanelDelegate is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c638) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x11576c4e0). One of the two will be used. Which one is undefined.
objc[35814]: Class QCocoaApplicationDelegate is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c340) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03b88). One of the two will be used. Which one is undefined.
objc[35814]: Class QNSApplication is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c2f0) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03bd8). One of the two will be used. Which one is undefined.
objc[35814]: Class QCocoaMenuLoader is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c2a0) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03d18). One of the two will be used. Which one is undefined.
objc[35814]: Class QNSImageView is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c660) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03e08). One of the two will be used. Which one is undefined.
objc[35814]: Class QNSStatusItem is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c6b0) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03e58). One of the two will be used. Which one is undefined.
objc[35814]: Class QNSOpenSavePanelDelegate is implemented in both /Users/username/python_env/py3env/lib/python3.5/site-packages/cv2/.dylibs/QtGui (0x11439c480) and /Users/username/python_env/py3env/lib/python3.5/site-packages/PyQt5/Qt/plugins/platforms/libqcocoa.dylib (0x117b03ef8). One of the two will be used. Which one is undefined.
cv2和pyqt5冲突

操作系统是macOS High Sieera,python版本是3.5.2,使用venv创建了一个虚拟环境,其中执行了“pip install pyqt5”、“pip install opencv python”,并安装了库

在ubuntu和windows中,它正常工作,没有错误,但只有mac不工作


如何解决错误?

我的代码也有同样的问题。这是因为opencv和pyqt5的冲突。我通过安装一个无头版本的opencv解决了这个问题

你能展示一段代码来更好地理解这一点吗?