利用清华大学开源软件镜像站下载包
先在C:\Users\Administrator路径下创建一个pip文件夹,在文件夹里面创建一个pip.ini文件
并将底下这串代码粘贴进去
[global]
trusted-host=mirrors.tuna.tsinghua.edu.cn/help/pypi/
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
use-mirrors = true
mirrors = https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
[list]
format=columns
这个的意思是将清华大学开源软件镜像站的网站放进去,然后利用下面这串代码调用它去下载包
下载包的时候用底下这串代码就ok了
pip install --trusted-host mirrors.tuna.tsinghua.edu.cn/help/pypi/ -i https://pypi.tuna.tsinghua.edu.cn/simple input
当然了,你也可以用其他的镜像网站,你只需要修改pip.ini文件里的内容就可以了,这里解释一下
trusted-host和mirrors后面跟的是镜像站的网址
index-url后面跟的是镜像包的网址
快去试试吧!