在pip
命令中添加参数 -i
和镜像
常用镜像如下:
使用:
假设使用清华镜像下载tensorflow
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
修改 ~/.pip/pip.conf
(没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)
内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
亲测速度大幅度提升
终端直接运行一下命令
# 添加 Anaconda 的 TUNA 镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# TUNA 的 help 中镜像地址加有引号,需要去掉
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes