在阅读所有这些之前:
我只想从系统中删除所有的OpenCV痕迹,所以我可以重新开始..
整个故事
很久以前,我首先从https://launchpad.net/~gijzelaar/+archive/opencv2安装了python-opencv和libopencv(2.1我认为)。那时候我只尝试过python-opencv,它工作得很好(我没有尝试使用OpenCV使用C代码)
然后我最近试图从源代码安装OpenCV 2.3.1,但是在编译我自己的C代码(使用OpenCV)的时候,它给了我关于libgtk没有安装的错误,也破坏了我早期运行的python opencv代码
所以我安装了libgtk2-dev库并再次编译并安装了OpenCV 2.3.1。
错误仍然发生,所以我删除了我正在运行cmake,make等的untarred OpenCV目录。我没有卸载(我现在意识到是我的错误)
而是从这里安装ubuntu opencv 2.3软件包(包括所有依赖项):https://launchpad.net/~gijzelaar/+archive/opencv2.3
现在问题是我仍然得到相同的错误,当我编译我的C代码,其中包括OpenCV,并且错误仍指向我的(删除)OpenCV源文件夹:
OpenCV Error: Unspecified error (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 cvNamedWindow,file /home/anant/opencv/OpenCV-2.3.1/modules/highgui/src/window.cpp,line 275 terminate called after throwing an instance of 'cv::Exception' what(): /home/anant/opencv/OpenCV-2.3.1/modules/highgui/src/window.cpp:275: error: (-2) The function is not implemented. Rebuild the library with Windows,then re-run cmake or configure script in function cvNamedWindow
可以看到错误仍然指向从我编译和安装OpenCV的目录
有没有办法完全删除OpenCV编译版本的所有痕迹,只需保留ubuntu软件包中的文件?如前所述,我没有“卸载”,并且(愚蠢地)删除了install-manifest
编辑:
我再次运行包管理器,发现并不是所有的ppa的opencv包都已经正确安装了。所以我做了一个sudo apt-get再次安装opencv,现在我得到这个错误:
Unpacking libopencv2.3 (from .../libopencv2.3_2.3.1-3_amd64.deb) ... dpkg: error processing /var/cache/apt/archives/libopencv2.3_2.3.1-3_amd64.deb (--unpack): trying to overwrite '/usr/lib/libopencv_video.so.2.3.1',which is also in package libopencv-video2.3 2.3.1-4ppa1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Unpacking opencv (from .../opencv_2.3.1-3_amd64.deb) ... dpkg: error processing /var/cache/apt/archives/opencv_2.3.1-3_amd64.deb (--unpack): trying to overwrite '/usr/bin/opencv_haartraining',which is also in package libopencv-core-dev 2.3.1-4ppa1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/libopencv2.3_2.3.1-3_amd64.deb /var/cache/apt/archives/opencv_2.3.1-3_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
我只想从系统中删除OpenCV的所有痕迹,所以我可以重新开始
您还可以使用Linux find命令。所以,要找到所有OpenCV库,您可以执行以下操作(这可能需要一段时间):
$> sudo find / -name "*opencv*" -exec rm -i {} \;
上述命令将在名称中找到包含opencv的任何文件,并将提示您将其删除。和往常一样,手动删除东西时要小心!
另一个选择可能是再次手动编译OpenCV(与之前完全一样),make install创建安装清单,然后尝试卸载来查看是否将自己清理。
希望有帮助!