anaconda独立环境下安装的opencv不能使用,让人很是烦躁,思考后明白了一个问题:anaconda推荐的最优版本并不是万能的,有很多时候跟系统和代码环境需求有关系(当然大部分时间是对的),下午各种碰壁解决了opencv的问题,这里记录一下。
error: -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage.
先大概说一下我的情况:
系统Ubuntu16.04
想用Python,所以直接装了Anaconda,Pycharm,然后用conda install ...这种命令开始安装各种包。
装完了opencv之后读取图片有问题
error: -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage.
找半天资料在这里https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/uHB2wYT29vU找到答案,应该把安装时命令换成
conda install -c menpo opencv3
一定要用 menpo,别的就出错了。
---------------------
作者:flyyufenfei
原文:https://blog.youkuaiyun.com/flyyufenfei/article/details/79192330
---------------------
还有一位大佬,用的别的源下载的,一样的解决思路,链接如下,侵删,感谢!
---------------------
作者:叶家小右
原文:https://blog.youkuaiyun.com/feiye1023/article/details/80766089
---------------------