Python pip源更改镜像-清华大学

在安装python第三方包时,cmd下载,速度一般比较慢。需要使用镜像改善速度。

1、临时使用镜像

使用清华大学(https://pypi.tuna.tsinghua.edu.cn/simple/)的镜像,下载pandas库。

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

2、永久使用镜像

使用清华大学(https://pypi.tuna.tsinghua.edu.cn/simple/)的镜像,下载pandas库。

windows:

① 在C盘下的user目录中,新建一个pip文件夹,在此文件夹中,再新建一个pip.ini文件。如下图所示:

② 打开pip.ini文件,可用sublime text3 打开,写上如下图所示的语句。

[global]
index-url =https://pypi.tuna.tsinghua.edu.cn/simple

[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

③在cmd中,输入pip install pandas 时, 就可以看到,镜像已经安排上了。如下图所示。

发布了35 篇原创文章 · 获赞 26 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/weixin_42342968/article/details/105364130