pip配置国内pypi源

pip安装默认走的是官方的仓库,下载速度很慢,所以需要配置pypi源,才能使用pip进行安装依赖库

在windows下需要创建目录C:\Users\username.pip,然后新建并编辑配置文件

C:\Users\username\.pip\pip.ini

在linux下需要创建目录~/.pip,然后新建并编辑配置文件

vim ~/.pip/pip.conf

pypi源:

1、阿里云pypi源

[global]
index-url = https://mirrors.aliyun.com/pypi/simple

[install]
trusted-host = mirrors.aliyun.com

2、豆瓣pypi源(不建议)

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com

3、清华pypi源

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
posted @ 2022-04-02 14:28  ct-debug  阅读(492)  评论(0)    收藏  举报