1. 程式人生 > 其它 >Python pip Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

Python pip Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

 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/