方法一:source安装
1.安装
https://blog.csdn.net/wangyulj/article/details/79017312
2.编译时出现问题
How to fix held broken packages?
https://unix.stackexchange.com/questions/389156/how-to-fix-held-broken-packages
https://blog.csdn.net/sinkary/article/details/16804017
3.cmake出现问题
解决方法:按照https://docs.opencv.org/master/d2/de6/tutorial_py_setup_in_ubuntu.html里的cmake命令
cmake ..
sudo make # make -j4表示开4个线程来进行编译
sudo make install
安装完成。
方法二:
用conda装
命令:
conda install opencv