Windows 10, Python 3.8
pip install opencv-python
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
解决办法
前往下面地址,下载和安装OpenSSL:
https://slproweb.com/products/Win32OpenSSL.html
下载对应自己系统的OpenSSL的EXE安装包,选择的是 Win64 OpenSSL v1.1.1n (下载文件链接 https://slproweb.com/download/Win64OpenSSL-1_1_1n.exe ),安装之后就可以正常使用了(安装在默认路径C盘)。采用迅雷下载比较快。
============================
安装 cv2
E:\Eprogramfiles\Anaconda3\Scripts>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
E:\Eprogramfiles\Anaconda3\Scripts>pip install opencv-python -i https://pypi.mirrors.ustc.edu.cn/simple/