python更改下载源地址 (WARNING: The repository located at mirrors.aliyun.com is not a trusted )

编程知识 更新时间:2023-04-06 18:06:25

文章目录

  • python更改下载源地址
    • 工作中遇到的问题总结
      • WARNING: The repository located at mirrors.aliyun is not a trusted

python更改下载源地址

python默认的pip源在国外,如果下载比较大的第三方库时可能会非常非常慢,甚至会报错,所以为了有一个更加友好的python使用体验,建议为python的pip换一下源。

临时使用pip源

在使用pip时候,后面加上参数-i 镜像地址,例如:

pip3 install pygame -i http://mirrors.aliyun/pypi/simple/

永久修改:

pip config set global.index-url http://mirrors.aliyun/pypi/simple/

豆瓣・・・・・・・・・・・・・・・http://pypi.douban/
华中理工大学・・・・・・・・http://pypi.hustunique/
山东理工大学・・・・・・・・http://pypi.sdutlinux/
中国科学技术大学・・・・http://pypi.mirrors.ustc.edu/
阿里云・・・・・・・・・・・・・http://mirrors.aliyun/pypi/simple/

[root@localhost bin]# ./pip config set global.index-url http://mirrors.aliyun/pypi/simple/
Writing to /root/.config/pip/pip.conf

工作中遇到的问题总结

WARNING: The repository located at mirrors.aliyun is not a trusted

WARNING: The repository located at mirrors.aliyun 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 warning and allow it anyway with ‘–trusted-host mirrors.aliyun’.
ERROR: Could not find a version that satisfies the requirement Pillow3.4.2 (from versions: none)
ERROR: No matching distribution found for Pillow
3.4.2
WARNING: The repository located at mirrors.aliyun 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 warning and allow it anyway with ‘–trusted-host mirrors.aliyun’.

解决方法:根据错误提醒,添加 --trusted-host mirrors.aliyun 即可,如下

[root@localhost bin]# ./pip install -r requirements.txt --trusted-host mirrors.aliyun

更多推荐

python更改下载源地址 (WARNING: The repository located at mirrors.aliyun.com is not a tr

本文发布于:2023-04-06 18:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/7a6c12a243c33772c05e5f208f241e58.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:源地址   repository   WARNING   python   aliyun

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 50240文章数
  • 14阅读数
  • 0评论数