pip install PyQt5 ssl error

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证书配置问题引起的。您可以尝试以下几种方法来解决这个问题:

  1. **更新pip:** 首先,尝试更新pip到最新版本,因为较新版本的pip可能会修复一些SSL证书验证问题。您可以使用以下命令来更新pip:

```

python -m pip install --upgrade pip

```

  1. **更新证书:** 如果您使用的是较旧的Python版本,可能需要更新根证书。您可以手动下载最新的根证书,并按照Python文档中的步骤安装它们。您可以在这里找到Python文档:[Installing Certificates](https://docs.python.org/3/library/ssl.html#certificates)

  2. **禁用SSL证书验证:** 尽管不建议这样做,但是您可以在pip安装时暂时禁用SSL证书验证。在命令行中执行以下命令:

```

pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org pyqt5

```

请注意,禁用SSL证书验证存在一定的安全风险,因为它可能会使您的连接容易受到中间人攻击。

  1. **使用代理:** 如果您在网络环境中使用了代理,请确保pip能够正确配置和使用代理。您可以在pip的配置文件中设置代理信息,或者在命令行中使用 `--proxy` 选项。

尝试以上方法中的一个或多个,看看是否能够解决您的问题。如果问题仍然存在,请提供更多细节,以便我能够更好地帮助您解决。

终极解决打法
shiboken2 · PyPI whl文件下载

然后安装,可能会依赖文件有些把依赖的文件安装

bash 复制代码
pip install  C:\Users\Downloads\PyQt5-5.15.10-cp37-abi3-win_amd64.whl
相关推荐
Dfreedom.6 分钟前
一文掌握Python四大核心数据结构:变量、结构体、类与枚举
开发语言·数据结构·python·变量·数据类型
一半烟火以谋生6 分钟前
Python + Pytest + Allure 自动化测试报告教程
开发语言·python·pytest
叶子丶苏1 小时前
第八节_PySide6基本窗口控件_按钮类控件(QAbstractButton)
python·pyqt
百锦再2 小时前
对前后端分离与前后端不分离(通常指服务端渲染)的架构进行全方位的对比分析
java·开发语言·python·架构·eclipse·php·maven
Blossom.1182 小时前
把AI“刻”进玻璃:基于飞秒激光量子缺陷的随机数生成器与边缘安全实战
人工智能·python·单片机·深度学习·神经网络·安全·机器学习
Kratzdisteln3 小时前
【Python OOP Diary 1.1】题目二:简单计算器,改错与优化
python·面向对象编程
小白银子3 小时前
零基础从头教学Linux(Day 53)
linux·运维·python
skywalk81633 小时前
基于频域的数字盲水印blind-watermark
linux·开发语言·python
applepie_max4 小时前
GraphRAG本地部署 v2.7.0
python·rag·graphrag
sulikey4 小时前
从零配置一个规范的 Python Git 仓库(适用于 Gitee / GitHub)
git·python·pycharm·gitee·github