pip install xxx:There was a problem confirming the ssl certificate: HTTPSConnectionPool

一、Pip 安装报错

(myenv) PS E:\WorkSpace\1v6_code_fs> pip install librosa
ction has been closed (EOF) (_ssl.c:1131)'))': /simple/librosa/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL conne
ction has been closed (EOF) (_ssl.c:1131)'))': /simple/librosa/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL conne
ction has been closed (EOF) (_ssl.c:1131)'))': /simple/librosa/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL conne
ction has been closed (EOF) (_ssl.c:1131)'))': /simple/librosa/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL conne
ction has been closed (EOF) (_ssl.c:1131)'))': /simple/librosa/
Could not fetch URL https://pypi.org/simple/librosa/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max ret
ries exceeded with url: /simple/librosa/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))) - skipping        
ERROR: Could not find a version that satisfies the requirement librosa (from versions: none)
ERROR: No matching distribution found for librosa
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(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))) - skipping

二、原因

此时需要获得 ssl证书的认证,需要在原来的安装命令后增加:

-i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com (也可换其他源)

三、修复问题

pip3 install librosa -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

四、安装成功

Collecting zipp>=0.5 (from importlib-metadata->numba>=0.51.0->librosa)
  Downloading http://mirrors.aliyun.com/pypi/packages/8c/08/d3006317aefe25ea79d3b76c9650afabaf6d63d1c8443b236e7405447503/zipp-3.16.2-py3-none-any.whl (7.2 kB)
Building wheels for collected packages: audioread
  Building wheel for audioread (setup.py) ... done
  Created wheel for audioread: filename=audioread-3.0.0-py3-none-any.whl size=23735 sha256=d22a49cfd769abbb8249164f50d4cab5bbe3d373b2c2e9202ac21ee1fb550e5e      
  Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\5e\a3\68\8c80fc6d838bc1506593318e8148d50535c1190d2269574ca3
Successfully built audioread
Installing collected packages: msgpack, zipp, urllib3, typing-extensions, threadpoolctl, pycparser, platformdirs, packaging, numpy, llvmlite, lazy-loader, joblib
, idna, decorator, charset-normalizer, certifi, audioread, soxr, scipy, requests, importlib-metadata, cffi, soundfile, scikit-learn, pooch, numba, librosa       
Successfully installed audioread-3.0.0 certifi-2023.7.22 cffi-1.15.1 charset-normalizer-3.2.0 decorator-5.1.1 idna-3.4 importlib-metadata-6.8.0 joblib-1.3.2 lazy
-loader-0.3 librosa-0.10.1 llvmlite-0.40.1 msgpack-1.0.5 numba-0.57.1 numpy-1.24.4 packaging-23.1 platformdirs-3.10.0 pooch-1.7.0 pycparser-2.21 requests-2.31.0 
scikit-learn-1.3.0 scipy-1.10.1 soundfile-0.12.1 soxr-0.3.6 threadpoolctl-3.2.0 typing-extensions-4.7.1 urllib3-2.0.4 zipp-3.16.2

你可能感兴趣的:(pip,ssl,网络协议)