ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)

安装cv2时遇到错误

在PyCharm中没有安上cv2,于是去命令行安装,输入如下命令:

pip install cv2

遇到错误:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)_第1张图片

错误的第一行意思是:

错误:找不到满足要求 cv2 的版本(来自版本:无)

错误第二行意思是:

错误:未找到 cv2 的匹配分布

解决

换种命令即可:

win + R ----> cmd 回车,进入本机 Win11 终端窗口。

输入以下命令:

pip install opencv-python

没有使用镜像的方式,会慢一些,但好在安装包不大。等待几分钟即可:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)_第2张图片
可以在 PyCharm 中看到啦:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)_第3张图片

不再报错(之间报错的图忘记截了 o(╥﹏╥)o),可以成功导入模块:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)_第4张图片
也可以进一步在PyCharm下自带的终端导入试试:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)_第5张图片

你可能感兴趣的:(【工具,技巧,解决办法】,python,opencv,cv2)