第一步安装Python(Linux和maxOS一般自带,win得自己装)
第二步:安装OpenCV
—-命令
1、pip3 install opencv_python -i https://pypi.mirrors.ustc.edu.cn/simple/
(这里我用的是中科大的源,因为离得近)
2、pip3 install opencv-contrib-python -i https://pypi.mirrors.ustc.edu.cn/simple/
第三步:检查
调出终端,输入python3,回车
进入python后,输入import cv2,回车
不报错就说明安装成功
然后可以检查版本输入cv2.version,回车
附录:
这里我给几个常用的源的网址
https://pypi.tuna.tsinghua.edu.cn/simple/ # 清华大学
https://mirrors.aliyun.com/pypi/simple/ # 阿里云
https://pypi.douban.com/simple/ # 豆瓣
https://pypi.mirrors.ustc.edu.cn/simple/ # 中国科学技术大学
https://pypi.hustunique.com/ # 华中科技大学
原文链接:https://blog.csdn.net/qq_30893653/article/details/108427063
© 版权声明
文章版权归作者所有,未经允许请勿转载。