python pip安装 更换国内镜像源

发布时间 2023-07-28 15:51:09作者: 唏嘘-

1、临时修改镜像源

在安装库的时候,临时需要用到某个镜像,这里以清华大学镜像为例下载pandas库

pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/

2、永久修改镜像源

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/