解决办法: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python-headless 用了清华的镜像,这样速度比较快 然后再运行一遍代码成功