python安装第三方包异常【SSLEOFError】、[SSL: CERTIFICATE_VERIFY_FAILED]

Could not fetch URL https://pypi.org/simple/xxxx/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/xxxx

l/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)) - skipping

ERROR: Could not find a version that satisfies the requirement xxxx (from versions: none)

ERROR: No matching distribution found for xxxx

原因:

python高版本需要验证ssl,可以添加--trusted-host 来解决,所有host都得--trusted-host

解决:

bash 复制代码
# 这里用的国内清华镜像源,注意安装包xxxx需要替换为你要安装的第三方包
pip --trusted-host pypi.python.org --trusted-host pypi.tuna.tsinghua.edu.cn install xxxx -i https://pypi.tuna.tsinghua.edu.cn/simple/
相关推荐
垆边人似月.5 分钟前
Python中如何使用get函数实现频次查询
服务器·前端·python
AI 编程助手GPT23 分钟前
GPT 脚本别只发一个文件:用 uv 把依赖和锁一起交付
人工智能·python·gpt·uv·依赖管理
Patrick在香港44 分钟前
第 16,216 次连接之后,它不干了
python·网络编程·socket·tcp·连接池
我命由我123451 小时前
Python 开发 - Python 虚拟环境
运维·开发语言·后端·python·http·https·java-ee
云和数据.ChenGuang1 小时前
LLM大模型对接本地Ollama部署模型
开发语言·人工智能·python·langchain
云和数据.ChenGuang2 小时前
光哥说Python 循环导入(Circular Import)深度解析:成因、排查与解决方案
开发语言·前端·人工智能·python·langchain
TomEval2 小时前
【测AI】第16篇:模型公平性与可解释性测试 — AI 的偏见与黑箱
人工智能·python·功能测试·ai·测试用例
田里的水稻2 小时前
FA_CNN卷积神经网络四---线性层及其拉平PyTorch
人工智能·pytorch·python·深度学习·神经网络·cnn
钱栈up2 小时前
GitHub热榜上手|Claude插件:4.3万星官方目录
python·开源·github
青春不朽5122 小时前
Python 的 list append 为什么是均摊 O(1)?拆开过度分配那张表,看容量翻倍背后的暗账
java·python·list