Python Install 报错”‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED]

这篇具有很好参考价值的文章主要介绍了Python Install 报错”‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED]。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题描述

PS C:\temp> python -m pip install --upgrade pip

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: self signed certificate in certificate chain (_ssl.c:1108)'))': /simple/pip/

WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /simple/pip/

WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /simple/pip/

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: self signed certificate in certificate chain (_ssl.c:1108)'))': /simple/pip/

ERROR: Operation cancelled by user

Could not fetch URL ​ ​https://pypi.org/simple/pip/:​​ There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))) - skipping

解决方案

1. 临时解决方案

信任 pip install 时候加入可选命令 --trusted-host pypi.org , 仅单次安装有效

信任官网链接: python -m pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org

临时使用镜像: pip install pillow -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

建议使用下面的三种:
--trusted-host pypi.python.org
--trusted-host files.pythonhosted.org
--trusted-host pypi.org

2. 持久性解决方案

每次都输入那么长的指令是很难受的,下面说下windows电脑下解决方案
win+E 打开文件浏览器,在地址栏输入%APPDATA% 会打开roming文件夹,进入pip文件夹,如果没有就新建,新建pip.ini文件,输入下面内容文章来源地址https://www.toymoban.com/news/detail-530424.html

[global]
timeout = 6000
index-url=http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org

到了这里,关于Python Install 报错”‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Python单接口请求和接口自动化框架请求解决Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAIL

    项目实践总结2种处理SSLError的办法,下面就详细说明一下 接口请求示例如下: 导入urllib3,导包下面写上urllib3.disable_warnings(),在请求中加上verify=False。 data: request_data: method: GET url: - https://xxx/open/pick/codeId?signMode=1clientId=af901bbe8b9f0f3eebc3db46aba8d209signTimestamp=signTimesignData=signData bo

    2024年02月08日
    浏览(40)
  • requests出现ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)解决方案

      大家好,我是爱编程的喵喵。双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中。从事机器学习以及相关的前后端开发工作。曾在阿里云、科大讯飞、CCF等比赛获得多次Top名次。现为CSDN博客专家、人工智能领域优质创作者。喜欢通过博客创作

    2024年02月11日
    浏览(32)
  • windows: pip install 报错SSLError Can‘t connect to HTTPS URL because the SSL module is not available

    windows anaconda pip清华源 通过pip install 安装不成功,会报错(Caused by SSLError(\\\"Can\\\'t connect to HTTPS URL because the SSL module is not available.\\\")) 错误详情如下: 具体是什么错误什么原因导致,不去深究了。或许是源本身有问题?下面直接提供解决方法,通过更换源解决了该错误 加上--truste

    2024年02月15日
    浏览(35)
  • 解决python报错[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:

    这个错误经常发生在在线下载代码, 模型文件或数据的时候。发生这个错误的原因是没有正确配置网络的证书相关的东西。 解决办法: 全局取消证书验证 参考: https://www.jianshu.com/p/7d8eee279e7d

    2024年02月10日
    浏览(29)
  • Python发送邮件报错:ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)

    做自动化发送邮件提醒功能时发现无法连接smtp.office365.com服务器,报ssl版本错误。 这是一个 Python 中的 SSL 错误,通常表示请求的 SSL 版本不受支持。这通常是因为该服务器支持的 SSL 版本与客户端请求的版本不匹配。如果遇到此错误,可以通过以下几种方法解决: 更新到最新

    2024年02月02日
    浏览(25)
  • 【python】ssl.SSLCertVerificationError

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007) 在  requests.get() 函数里加 verify=False ,这样客户端就不会校验 SSL;

    2024年01月24日
    浏览(28)
  • python爬虫ssl.SSLCertVerificationError解决办法

    python当使用requests.get获取https链接时,提示如下错误: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 方法一: 最方便的手段是直接设置不验证,即: 方法二: 全局取消证书验证,简易方便,但对整个项目可能会

    2024年02月15日
    浏览(30)
  • 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 requi

    2024年02月11日
    浏览(18)
  • python https urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

    Python 2.7.9 之后引入了一个新特性,当使用urllib.urlopen打开一个 https 链接时,会验证一次 SSL 证书。而当目标网站使用的是自签名的证书时就会抛出一个 urllib2.URLError: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 的错误 解决方案 1.局部处理方案 使用ssl创建未经验证的

    2024年02月05日
    浏览(27)
  • python3/pip3 SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

    mac os 电脑之前安装的是python3.9 , 现在升级到python3.10。 从python官网下载macos版本的python3.10 pkg。 双击安装。 程序使用aiohttp访问ebay 。 但是旧版本python执行程序时不会出现以上问题。猜是新python的环境没配置好。 进入python 3.10 的application安装路径。 执行证书安装命令: 安装

    2024年02月11日
    浏览(28)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包