1,pip安装命令
pip install opencv-python
2,镜像源安装加快下载速度
pip install opencv-python -i https://pypi.douban.com/simple --trusted-host pypi.douban.com
3,验证是否安装成功(在conda环境中)
python
import cv2
没有报错则说明安装成功!!!
4,如果报以下错误:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
则pip安装opencv-python-headless:
pip install opencv-python-headless
镜像源安装:
pip install opencv-python-headless -i https://pypi.douban.com/simple --trusted-host pypi.douban.com