一.先将pip换源,官方源太慢经常失败.替换成阿里的
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/ pip config set install.trusted-host mirrors.aliyun.com
然后pip install opencv-python, 下载完成自动安装. 但是使用的时候有可能会报这个错误
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
二.继续pip install opencv-python-headless (可能直接安装这个也可以,保险起见都安上最好)
轻松搞定~~