修改pip源为国内镜像,加速python包下载

2022-02-23  本文已影响0人  沉思的雨季

方法一、通过命令设置

通过shell或者DOS命令窗口,执行以下命令:

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

方法二、修改配置文件

在Linux系统,修改~/.pip/pip.conf文件;在Windows系统,修改C:\Users\XXX\pip\pip.ini文件。如果没有上述文件,需要手动建立。
在文件中输入以下内容:

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

附:pip国内镜像源

阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/

上一篇 下一篇

猜你喜欢

热点阅读