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

相关链接

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。