安装模块cv2报错:
pip install cv2
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:9
97)'))': /simple/cv2/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:9
97)'))': /simple/cv2/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:9
97)'))': /simple/cv2/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:9
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:9
97)'))': /simple/cv2/
Could not fetch URL https://pypi.org/simple/cv2/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple
/cv2/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) - skipping
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2
应该安装opencv-python
pip install opencv-python -i https://pypi.douban.com/simple/
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
Looking in indexes: https://pypi.douban.com/simple/
Collecting opencv-python
Downloading https://pypi.doubanio.com/packages/48/c3/798bd7b8f78430f82ec0660b753106717e4e4bb8032ce56f77d8577cb24b/opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.4/35.4 MB 6.8 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.14.5 in d:\python310\lib\site-packages (from opencv-python) (1.22.1)
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
Installing collected packages: opencv-python
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
Successfully installed opencv-python-4.5.5.64
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python310\lib\site-packages)
本文介绍了在使用pip安装cv2模块时遇到的SSL证书验证错误,并提供了正确的安装方法,即通过指定豆瓣源来安装opencv-python模块。
5167

被折叠的 条评论
为什么被折叠?



