Could not fetch URL https://pypi.org/simple/pyqt5/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyqt5/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))) - skipping WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))': /simple/pyqt5/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('_ssl.c:990: The handshake operation timed out'))': /simple/pyqt5/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('timed out'))': /simple/pyqt5/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))': /simple/pyqt5/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))': /simple/pyqt5/ ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none) ERROR: No matching distribution found for PyQt5
pip install PyQt5
报错
这个错误通常是由于Python环境的SSL证书配置问题引起的。您可以尝试以下几种方法来解决这个问题:
- **更新pip:** 首先,尝试更新pip到最新版本,因为较新版本的pip可能会修复一些SSL证书验证问题。您可以使用以下命令来更新pip:
```
python -m pip install --upgrade pip
```
-
**更新证书:** 如果您使用的是较旧的Python版本,可能需要更新根证书。您可以手动下载最新的根证书,并按照Python文档中的步骤安装它们。您可以在这里找到Python文档:[Installing Certificates](https://docs.python.org/3/library/ssl.html#certificates)
-
**禁用SSL证书验证:** 尽管不建议这样做,但是您可以在pip安装时暂时禁用SSL证书验证。在命令行中执行以下命令:
```
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org pyqt5
```
请注意,禁用SSL证书验证存在一定的安全风险,因为它可能会使您的连接容易受到中间人攻击。
- **使用代理:** 如果您在网络环境中使用了代理,请确保pip能够正确配置和使用代理。您可以在pip的配置文件中设置代理信息,或者在命令行中使用 `--proxy` 选项。
尝试以上方法中的一个或多个,看看是否能够解决您的问题。如果问题仍然存在,请提供更多细节,以便我能够更好地帮助您解决。
终极解决打法
shiboken2 · PyPI whl文件下载
然后安装,可能会依赖文件有些把依赖的文件安装
bash
pip install C:\Users\Downloads\PyQt5-5.15.10-cp37-abi3-win_amd64.whl