如何彻底解决Python包下载速度慢的问题?

2026-05-05 12:220阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计573个文字,预计阅读时间需要3分钟。

如何彻底解决Python包下载速度慢的问题?

由于Python默认使用的镜像为国外镜像,有时下载速度较慢,最快的方法是在下载命令中添加国内源。例如,使用清华大学的国内源安装requests库:

bashpip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple

常用的国内源还包括:

- 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple- 中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple- 华中科技大学:https://pypi.hustunique.com/- 中国科学院:https://pypi.cn/- 北京理工大学:https://pypi.bjut.edu.cn/

因为python默认使用的是国外镜像,有时候下载非常慢,最快的办法就是在下载命令中增加国内源:

pip install requests -i pypi.tuna.tsinghua.edu.cn/simple

常用的国内源如下:

清华大学 pypi.tuna.tsinghua.edu.cn/simple/

阿里云 mirrors.aliyun.com/pypi/simple/

中国科技大学 pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) pypi.douban.com/simple/

中国科学技术大学 pypi.mirrors.ustc.edu.cn/simple/

但是每次都要输入url特别不方便,其实我们可以全局修改pip的下载源,这样以后都不需要写国内源的路径了。

阅读全文

本文共计573个文字,预计阅读时间需要3分钟。

如何彻底解决Python包下载速度慢的问题?

由于Python默认使用的镜像为国外镜像,有时下载速度较慢,最快的方法是在下载命令中添加国内源。例如,使用清华大学的国内源安装requests库:

bashpip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple

常用的国内源还包括:

- 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple- 中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple- 华中科技大学:https://pypi.hustunique.com/- 中国科学院:https://pypi.cn/- 北京理工大学:https://pypi.bjut.edu.cn/

因为python默认使用的是国外镜像,有时候下载非常慢,最快的办法就是在下载命令中增加国内源:

pip install requests -i pypi.tuna.tsinghua.edu.cn/simple

常用的国内源如下:

清华大学 pypi.tuna.tsinghua.edu.cn/simple/

阿里云 mirrors.aliyun.com/pypi/simple/

中国科技大学 pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) pypi.douban.com/simple/

中国科学技术大学 pypi.mirrors.ustc.edu.cn/simple/

但是每次都要输入url特别不方便,其实我们可以全局修改pip的下载源,这样以后都不需要写国内源的路径了。

阅读全文