当前位置:网站首页>关于anaconda中conda下载包或者pip下载包很慢的原因,加速下载包的方法(无视anaconda版本和环境)
关于anaconda中conda下载包或者pip下载包很慢的原因,加速下载包的方法(无视anaconda版本和环境)
2022-08-09 10:42:00 【模糊包】
加速的方法无非就是更改包的来源,也就是源位置。
所以我们先理解一下源位置
1. 源位置
所谓的源位置就是你的索引下载包的位置是哪里。打个比方,我们安装tensorflow的CUDA时候:版本CUDA10.1开始,在ubuntu安装方式是如下命令,
我们以cuda_10.2.89_440.33.01_linux_ppc64le.run为例子
$ wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux_ppc64le.run
$ sudo sh cuda_10.2.89_440.33.01_linux_ppc64le.run
这里面有一个命令wget和网址http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers
这个网址就是我们说的源位置。
为什么下载慢
因为我们的源位置默认是国外的网址地址,一般是从美国提供的云服务下载,索引不到的时候就是从日本下载,所以很慢。
2. conda提速
- 对于
Anaconda的下载方式就是conda install了,这个方式可以使用conda install -i 源的格式下载,但是太慢了,我们就永久更改位置即可,代码如下
# 1. 设置
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# 2. 生效
conda config --set show_channel_urls yes
这里提供多个源,大家自己选择的来(个人推荐使用尾缀是free的,这个很稳定比如main的快)
# 1. 中科大
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
# 2.清华
conda config --add https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
3. pip提速
这个很简单,因为pip的下载更新命令是pip install/update/upgrade [可选命令] 源位置 包文件名[==版本,默认最新],那么在[可选命令]加上-i即可,举例如下安装tensorflow
# 从清华安装tensorflow版本号为1.14
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade tensorflow-gpu==1.14.0
其中[可选命令]常用有下面的。
-i: 指定库的安装源
-U:升级 原来已经安装的包,不带U不会装新版本,带上U才会更新到最新版本。
边栏推荐
- 10000以内素数表(代码块)
- [Error record] Solve the problem that ASRock J3455-ITX cannot be turned on without a monitor plugged in
- 批量转换经纬度的网页实现方法
- 机器学习-逻辑回归(logistics regression)
- unix环境编程 第十五章 15.3 函数popen和pclose
- Transformer+Embedding+Self-Attention原理详解
- shell脚本实战(第2版)/人民邮电出版社 脚本1 在PATH中查找程序
- pytorch widedeep文档
- How to quickly get through the mirror release process?
- 1003 我要通过! (20 分)
猜你喜欢

自启服务mock联调跨域问题

【报错记录】解决华擎J3455-ITX不插显示器无法开机的问题

程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果

深度学习--生成对抗网络(Generative Adversarial Nets)

商业技术解决方案与高阶技术专题 - 数据可视化专题

【 original 】 VMware Workstation implementation Openwrt soft routing, the ESXI, content is very detailed!

PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization论文阅读
![[Original] Usage of @PrePersist and @PreUpdate in JPA](/img/a0/5aebdef4a12fe55b4782b69e39b817.png)
[Original] Usage of @PrePersist and @PreUpdate in JPA

Shell script combat (2nd edition) / People's Posts and Telecommunications Press Script 1 Find programs in the PATH

批量转换经纬度的网页实现方法
随机推荐
unix环境编程 第十五章 15.3 函数popen和pclose
Netscope:神经网络结构在线可视化工具
numpy库中的函数 bincount() where() diag() all()
Nodejs服务端
中断系统结构及中断控制
antd表单
2021-01-11-雪碧图做表情管理器
1003 我要通过! (20 分)
tensor.eq() tensor.item() tensor.argmax()
Oracle数据库常用函数总结
[Original] Usage of @PrePersist and @PreUpdate in JPA
MySQL索引的B+树到底有多高?
xmms的均衡器试验成功 音效相当不错 比rockbox可能还要好
Cpolar内网穿透的面板功能介绍
autogluon安装,使用指南,代码
Unix Environment Programming Chapter 14 14.8 Memory Mapped I/O
用Word写代码
上传张最近做的E2用的xmms的界面的截图
TELNET协议相关RFC
判断一段文字的width