pip conda 安装速度慢解决方法

时间:2022-07-24
本文章向大家介绍pip conda 安装速度慢解决方法,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1 pip 提速

1.1 临时提速

pip命令中添加参数 -i镜像 常用镜像如下:

使用: 假设使用清华镜像下载tensorflow

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

1.2 设置配置文件,永久提速

修改 ~/.pip/pip.conf(没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹) 内容如下:

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

亲测速度大幅度提升

2 conda 提速

终端直接运行一下命令

# 添加 Anaconda 的 TUNA 镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# TUNA 的 help 中镜像地址加有引号,需要去掉
 
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
  1. http://www.cnblogs.com/dahu-daqing/p/6911414.html