[人工智能-深度学习-78]:开发环境 - pip install cv2下载失败的解决办法

作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_CSDN博客

本文网址:https://blog.csdn.net/HiWangWenBing/article/details/122320433


目录

1. 出错现象

1.1 源代码import cv2失败

1.2 conda install cv2 失败

1.3 pip3 install cv2失败

2. 出错原因

3. 解决办法

4. 效果验证



1. 出错现象

1.1 源代码import cv2失败

import cv2
ImportError: No module named cv2
 

1.2 conda install cv2 失败

(base) C:\Users\wenbingw>conda install cv2

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): failed

1.3 pip3 install cv2失败

(base) C:\Users\wenbingw>pip3 install cv2

ERROR: Could not find a version that satisfies the requirement cv2
ERROR: No matching distribution found for cv2

2. 出错原因

cv2现在已经不叫cv2了,而叫做opencv-python

3. 解决办法

pip3  install opencv-python

上述安装,虽然可以解决按照CV2, 但按照过程太慢,35M的东西需要一个多小时。可以换个安装方法:

(1)通过链接下载文件cv2,

https://pypi.tuna.tsinghua.edu.cn/simple/opencv-python/

(2)pip3 install ./opencv_python-4.5.5.62-cp36-abi3-win_amd64.whl

4. 效果验证

python

>> import cv2

作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_CSDN博客

本文网址:https://blog.csdn.net/HiWangWenBing/article/details/122320433

你可能感兴趣的:(人工智能-深度学习,编程-Python系列,深度学习,开发环境,import,CV2)