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

无法解决SSL证书验证问题,求TensorFlow 1.12.0有效下载方法

解决TensorFlow 1.12.0安装SSL证书验证失败的替代方案

方案1:使用国内PyPI镜像源安装

国内镜像源可绕开SSL证书验证问题,同时提升下载速度,执行对应命令即可:

  • CPU版本:
    pip install tensorflow==1.12.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
    
  • GPU版本:
    pip install tensorflow-gpu==1.12.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
    

也可替换为阿里云、清华等其他国内镜像源,比如http://mirrors.aliyun.com/pypi/simple/。

方案2:手动下载whl文件本地安装

  1. 找到适配Python 3.5.4的TensorFlow 1.12.0 whl文件(需匹配你的操作系统和架构,如Windows amd64、Linux x86_64)
  2. 下载完成后,切换到文件所在目录,执行本地安装命令:
    pip install tensorflow-1.12.0-cp35-cp35m-<系统架构>.whl
    
    示例:Windows下GPU版本文件名通常为tensorflow_gpu-1.12.0-cp35-cp35m-win_amd64.whl

方案3:临时关闭pip的SSL验证

直接跳过SSL证书验证环节,适合临时解决问题(注意:此方法存在安全风险,仅在可信环境下使用):

  • CPU版本:
    pip install tensorflow==1.12.0 --trusted-host pypi.org --trusted-host files.pythonhosted.org --no-verify-ssl
    
  • GPU版本:
    pip install tensorflow-gpu==1.12.0 --trusted-host pypi.org --trusted-host files.pythonhosted.org --no-verify-ssl
    

方案4:更新系统SSL证书

若问题源于系统根证书过期,可尝试更新系统证书:

  • Windows:安装微软官方提供的最新根证书包
  • Debian/Ubuntu系Linux:
    sudo apt-get update && sudo apt-get install ca-certificates
    
  • CentOS/RHEL系Linux:
    sudo yum update ca-certificates
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.22 11:36:11