一键解决WARNING: The repository located at mirrors .aliyun.com is not a trusted or secure host and is be
  RRqNAiOO6ptj 2023年11月13日 35 0


这个错误提示是由于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选项中。


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
RRqNAiOO6ptj