There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate ve

在安装virtualenv的时候发现有如下报错:
在这里插入图片描述

Collecting virtualenv
  Cache entry deserialization failed, entry ignored
  Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/virtualenv/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777) - skipping
  Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
You are using pip version 9.0.1, however version 23.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

大致意思就是在说因为在确认ssl证书时出现了问题,从而导致无法无法获取https://pypi.tuna.tsinghua.edu.cn/simple/virtualenv/。

解决方法:

pip install xxx后面加上参数--trusted-host xxx(网站网址),例如:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U --trusted-host pypi.tuna.tsinghua.edu.cn

以此类推,可以更改成其他的源,如果你用的豆瓣源就可以写:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U --trusted-host pypi.tuna.tsinghua.edu.cn

效果如下所示:
**加粗样式**
我这里是在升级pip,也可以换成其他的第三方库。使用过一次这个参数之后,以后安装第三方库的时候不需要重复添加,我在使用一次--trusted-host之后安装vitualenv以及其他第三方库的时候,不会重复出现报错:
在这里插入图片描述

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值