opencv-python imshow()时报错

ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
objc[25692]: Class QCocoaColorPanelDelegate is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0d60) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95130). One of the two will be used. Which one is undefined.
objc[25692]: Class QMacSoundDelegate is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0db0) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95180). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaPanel is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0e00) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec951d0). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaView is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0e50) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95220). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaWindow is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0ea0) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95270). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaWindowDelegate is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0ef0) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec952c0). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaMenuLoader is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0f40) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95310). One of the two will be used. Which one is undefined.
objc[25692]: Class QNSApplication is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0f90) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95360). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaApplicationDelegate is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd0fe0) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec953b0). One of the two will be used. Which one is undefined.
objc[25692]: Class QCocoaWindowCustomThemeFrame is implemented in both /usr/local/lib/python2.7/site-packages/cv2/.dylibs/QtGui (0x104bd1030) and /usr/local/Cellar/qt@4/4.8.7_5/lib/QtGui.framework/Versions/4/QtGui (0x10ec95400). One of the two will be used. Which one is undefined.
鼓捣电脑不知道装了什么东西,利用opencv无法正常显示图片,差一点就打算重做系统了,最后抱着试一试的态度没想到解决了。
根据提示,大致是和Qt相关的,网上有说是装了两个qt版本导致出现冲突,于是就是用brew list 查了一下

localhost:PycharmProjects han$ brew list
adwaita-icon-theme		libpeas
aspell				libpng
atk				librsvg
autoconf			libtiff
automake			libtool
automoc4			libunistring
boost				libvorbis
cairo				libvpx
cmake				libxml2
doxygen				mpfr
eigen				mysql
enchant				mysql-connector-c
erlang				numpy
ffmpeg				open-scene-graph
fontconfig			openblas
freetype			openexr
fribidi				openssl
gcc				opus
gd				pango
gdbm				pcre
gdk-pixbuf			pixman
gedit				pkg-config
gettext				py2cairo
glib				pygobject
gmp				pygtk
gobject-introspection		pyqt
graphite2			pyqt@4
graphviz			python
gsettings-desktop-schemas	python3
gspell				python@2
gtk+				qt
gtk+3				qt-webkit@2.3
gtk-mac-integration		qt@4
gtkglext			rabbitmq
gtksourceview3			readline
harfbuzz			rename
hicolor-icon-theme		sdl
hiredis				sdl2
icu4c				sip
ilmbase				snappy
inetutils			sqlite
isl				tbb
iso-codes			telnet
jpeg				theora
lame				tmux
libcroco			vala
libepoxy			webp
libevent			wget
libffi				wxmac
libidn				x264
libidn2				x265
libmpc				xvid
libogg				xz

果真是装了两个Qt,于是卸载其中一个

localhost:PycharmProjects han$ brew uninstall qt@4

这样执行会有个报错

Error: Refusing to uninstall /usr/local/Cellar/qt@4/4.8.7_5
because it is required by automoc4, pyqt@4 and qt-webkit@2.3, which are currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies qt@4
localhost:PycharmProjects han$ brew uninstal --ignore-dependences qt@4
Usage: brew uninstall, rm, remove [options] formula

不要气馁,根据提示执行就Ok了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值