python pip换源
从官方渠道下载numpy和在cmd界面通过pip install ~命令安装会发现速度特别慢。
小编发现可以通过换源的方式提升下载速度:
一次性换源:
以numpy为例:pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
永久换源:
在我的电脑地址栏输%APPDATA%
新建文件夹名为pip
创建文件pip.ini
文件内容为
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
pip国内镜像源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/