You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行poetry install时出现SSL CERTIFICATE_VERIFY_FAILED报错如何解决?

报错原因

该报错为poetry拉取PyPI包元数据时SSL证书校验失败导致,常见触发场景包括系统根证书过期未更新、当前网络存在SSL代理/流量抓包工具、默认PyPI源连接异常。

可行修复方案
  • 方案1:临时跳过SSL验证(仅临时测试使用,不建议长期开启)
    执行安装命令时追加参数即可:

    poetry install --no-verify
    

    如需全局关闭校验(安全性低,不推荐):

    poetry config settings.disable_ssl_verify true
    
  • 方案2:指定poetry使用系统根证书校验
    先找到对应系统的根证书路径:

    • macOS:/etc/ssl/cert.pem
    • Linux:/etc/ssl/certs/ca-certificates.crt
    • Windows:C:\Windows\System32\curl-ca-bundle.crt
      执行配置命令:
    poetry config requests.ca-certificates <替换为你的系统根证书路径>
    
  • 方案3:更换国内PyPI镜像源
    默认PyPI源连接不稳定时,换国内镜像即可解决,在项目pyproject.toml中追加如下配置:

    [[tool.poetry.source]]
    name = "tsinghua"
    url = "https://pypi.tuna.tsinghua.edu.cn/simple"
    priority = "default"
    
  • 方案4:更新系统根证书
    你的报错对应Python 3.9版本,不同系统更新命令如下:

    • macOS:执行 /Applications/Python\ 3.9/Install\ Certificates.command
    • Debian/Ubuntu:执行 sudo apt update && sudo apt install ca-certificates && sudo update-ca-certificates
    • CentOS/RHEL:执行 sudo yum update ca-certificates && sudo update-ca-trust

内容的提问来源于stack exchange,提问作者alexa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.27 16:54:01