OpenCV can't be found but can be imported

China☆狼群 提交于 2021-01-29 10:31:20

问题


I've installed opencv from source using a virtualenv, however I faced some errors and needed to reinstall it. I tried removing all the files with sudo find / -name "opencv" -exec rm {} \; and checked if the package was removed with pkg-config --modversion opencv, and it said it could not be found, but when I open the terminal with python3 and enter import cv2 then print(cv2.__version__), the terminal returns 4.0.0. How can I completely remove opencv? I'm on Ubuntu 18.04 LTS.


回答1:


Run this command from your installed environment.

pip uninstall opencv-python

and if you are using Python3 than

pip3 uninstall opencv-python



回答2:


I found out that I hadn't uninstalled in the build folder, problem solved!



来源:https://stackoverflow.com/questions/54826979/opencv-cant-be-found-but-can-be-imported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!