由于转换模型需要py2.7环境,使用Anaconda 创建了python2.7 环境,安装 opencv:pip install opencv-python
。出现:
Could not find a version that satisfies the requirement python-opencv (from versions: )
No matching distribution found for python-opencv
原因: Opencv 最新版不再支持 Python 2.7,而 pip install opencv-python
命令会下载最新版本Opencv。
因此需要安装时指定opencv的老版本,最后一个支持 Python 2.7 的 Opencv 版本是 4.2.0.32
。
pip install opencv-python==4.2.0.32
即可。