pip install opencv_python error (resolved) WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect

import cv2

insert image description here

An error is reported because it is not installedNo module named ‘cv2’
insert image description here


cmd+r first enter python, then enter import cv2 to check whether the cv2 library is installed

insert image description here
Import cv2 is used when importing packages, but the package name is not cv2 when installing

So enter the command to install:

pip install opencv_python

After returning, the following error was reported:
insert image description here


Solution:

input the command:

pip install opencv_python -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

Douban is quite stable, and you can download basic packages, but it’s a bit slower outside the country, at least it can still be used in most cases

insert image description here
When successfully and version number appear, the installation is successful

After the installation is successful, check the code again and find that the error is gone (^-^)V

Guess you like

Origin blog.csdn.net/m0_50609545/article/details/129229882