咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

Linux Python包管理工具pip更换国内源

2023-06-16 13:38:35 10455次

Linux Python包管理工具pip更换国内源

pip默认安装后使用的国外Python官网默认源国内链接经常几十KB每秒或者超时,更换国内源后可加快国内连接速度。

首先来看国内常用的源

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

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

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

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

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

设置方法:

使用阿里云镜像源

mkdir ~/.pip

vi ~/.pip/pip.conf

填写以下内容后保存

[global]

index-url=http://www.landui.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

配置完成以后测试已经调用国内源

更新pip

python -m pip install --upgrade pip

更换成国内阿里后下载速度变快了


首页
最新活动
个人中心