(python + conda => anaconda ) + qt5 + opencv in ubuntu
2016-07-17 23:50
1386 查看
anaconda
problem in ubuntu
需要opencv2 + qt5 + pyqt+python科学环境先安装了qt5 和 anaconda2(python 科学环境,似乎自带pyqt)
但在编译安装opencv2的时候,不小心使用了系统默认的python2.7
This application failed to start because it could not find or load the Qt platform plugin "xcb"
通过安装miniconda是可以避免这个问题的
然而重装anaconda2,问题无法得到解决
finally
export QT_QPA_PLATFORM_PLUGIN_PATH=${QT5_ROOT}/plugins
another problem
Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion 'GTK_IS_WIDGET (widget)' failed
in fact, I cannot avoid it, but after change the qt style, the output of above message will be less.
If you are lazy enough, you can avoid use cv2.imshow() in python, instead we can use matplotlib or scikit-image.
sudo qtconfig #or sudo qtconfig-qt4
For I use Qt5, so change the style of qt4 is meaningless. I add this in
~/.bashrc, for more information view qt5 set default style
QT_STYLE_OVERRIDE=adwaita
finally, cv.imshow() works right, that’s fun.
In [4]: img=cv2.imread('/home/yzbx/Pictures/shot.png') In [5]: cv2.imshow('img',img) init done opengl support available In [6]: key=cv2.waitkey(0)
reference
official python-opencv install processopencv-qt5.3+
opencv-qt5 default
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- ubuntu下chrome无法同步问题解决
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- Ubuntu Linux使用体验
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析