成功解决WARNING: The repository located at mirrors .aliyun.com is not a trusted or secure host and is be

这个错误提示是由于pip在下载软件包时,发现了一个不受信任的镜像源,因此默认情况下会忽略它。

问题描述

WARNING: The repository located at mirrors .aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this waming and allow it anyway with '-trusted-host mirrors .aliyun.com"

解决思路

这个错误提示是由于pip在下载软件包时,发现了一个不受信任的镜像源,因此默认情况下会忽略它。

下滑查看解决方法

解决方法

如果你确定这个镜像源是可信的,你可以使用"–trusted-host mirrors.aliyun.com"选项来允许pip使用它。具体的解决方法如下:

在使用pip下载软件包时,添加"–trusted-host mirrors.aliyun.com"选项,
例如:

pip install package_name --trusted-host mirrors.aliyun.com

如果你需要在requirements.txt文件中指定软件包依赖,
可以在执行pip install命令时添加"–trusted-host mirrors.aliyun.com"选项,
例如:

pip install -r requirements.txt --trusted-host mirrors.aliyun.com

如果你想永久地添加这个镜像源,可以编辑pip的配置文件,将mirrors.aliyun.com添加到trusted-hosts选项中。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值