当前位置: 首页 > news >正文

conda 配置源

无论是Anaconda vs Miniconda vs Miniforge 中的哪个,只要使用conda就涉及源,换源的目的是为了加速包的获取

修改配置文件

通过修改用户目录下的 .condarc 文件来使用

不同系统下的 .condarc 目录如下:

  • Linux: ${HOME}/.condarc
  • macOS: ${HOME}/.condarc
  • Windows: C:\Users\<YourUserName>\.condarc

注:

  • Windows 用户无法直接创建名为.condarc 的文件,可先执行 conda config --set show_channel_urls yes 生成该文件之后再修改。
  • 由于更新过快难以同步,TUNA 等镜像站不同步pytorch-nightly , pytorch-nightly-cpu , ignite-nightly 这三个包。
  • 如果您正在从某一镜像源切换到另一镜像源,请检查镜像源是否同步了您所需要的 repo,以及该 repo 是否支持您使用的平台 (e.g. linux-64)。
  • 为了保证以下配置在所有镜像站可用,配置中只加入了少量必须的第三方源,

清华大学开源软件镜像站

channels:- defaults
show_channel_urls: true
default_channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

即可添加 Anaconda Python 免费仓库。

使用下列命令清除索引缓存,并安装常用包测试一下。

conda clean -i
conda create -n myenv numpy

使用命令

查看源

conda config --show-sources###
C:\Users\johnny>conda config --show-sources
==> C:\johnny\soft\miniforge3\.condarc <==
channels:- conda-forge==> C:\Users\johnny\.condarc <==
channels:- defaults
custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
default_channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
show_channel_urls: True

配置默认的源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

配置第三方源中

conda config --set custom_channels.conda-forge https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

其他镜像站

https://help.mirrors.cernet.edu.cn/anaconda/
https://mirrors.ustc.edu.cn/help/anaconda.html
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

http://www.lryc.cn/news/540785.html

相关文章:

  • 使用nvm管理node.js版本,方便vue2,vue3开发
  • Linux离线环境安装miniconda并导入依赖包
  • 【opencv】图像基本操作
  • 泛微OA编写后端Rest接口
  • AI助力下的PPT革命:DeepSeek 与Kimi的高效创作实践
  • 002 SpringCloudAlibaba整合 - Feign远程调用、Loadbalancer负载均衡
  • 计算机视觉之图像处理-----SIFT、SURF、FAST、ORB 特征提取算法深度解析
  • DeepSeek接入Siri(已升级支持苹果手表)完整版硅基流动DeepSeek-R1部署
  • elabradio入门第八讲——帧同步技术
  • 站长工具SEO综合查询是什么?怎么利用站长工具SEO综合查询
  • 超简单理解KMP算法(最长公共前后缀next数组、合并主子串、子串偏移法)
  • 【每日论文】TESS 2: A Large-Scale Generalist Diffusion Language Model
  • 如何在 React 中测试高阶组件?
  • 设计模式学习笔记
  • 写论文技巧 :Word文档插入图片,实现自动对齐
  • VSCode - VSCode 切换自动换行
  • postman传query一个数组类型的参数,并且数组里面只有一个值的时候
  • 【智能客服】ChatGPT大模型话术优化落地方案
  • vue3 文件类型传Form Data数据格式给后端
  • 高考或者单招考试需要考物理这科目
  • 深入剖析 DeepSeek:张量计算范式全解析
  • VSCode集成deepseek使用介绍(Visual Studio Code)
  • 【保姆级教程】DeepSeek R1+RAG,基于开源三件套10分钟构建本地AI知识库
  • vue,vue3 keepalive没有效果,无法缓存页面include无效,keep-alive
  • Windows逆向工程入门之指针类型
  • PHP+Apache+MySQL安装(Windows)
  • 算法基础 -- 堆排序之C语言实现
  • Hutool - Extra:功能丰富的扩展模块
  • C++ 中的继承详解(上)
  • halcon三维点云数据处理(二十五)moments_object_model_3d