python 编译报错:No module named ‘cv2’
解决办法:
命令提示符终端(Win键+R 输入“ cmd ” 回车)pip install opencv-python
如果网速过慢,可以使用国内镜像下载,当然有条件的翻墙应该也能下载到。
国内网速忙还总失败。
国内源:
清华: https://pypi.tuna.tsinghua.edu.cn/simple
阿里云: http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学: http://pypi.hustunique.com/
山东理工大学: http://pypi.sdutlinux.org/
豆瓣: http://pypi.douban.com/simple/
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
这样就会从清华这边的镜像去安装python-opencv库。
更新完成后安装 cv2 即可。