使用 mamba 提速 conda

1. 介绍

GitHub - mamba-org/mamba: The Fast Cross-Platform Package Manager: https://github.com/mamba-org/mamba

mamba 是 Conda 包管理器的 C++ 重新实现

  • 使用多线程并行下载存储库数据和包文件
  • 使用 libsolv 加速处理依赖关系
  • 为了提高效率,mamba 的核心部分使用 c++ 实现的
  • 为了提高兼容性,mamba 使用与 Conda 相同的命令行解析器、包安装和卸载代码以及事务验证例程。(即 mamba 和 Conda 用法几乎相同)

2. 安装

下载安装包,安装包地址:

GitHub - conda-forge/miniforge: A conda-forge distribution. https://github.com/conda-forge/miniforge#mambaforge

  • Windows 系统 双击 exe 文件
  • Linux Mac 系统 运行 bash Mambaforge-$(uname)-$(uname -m).sh 命令即可
    • 请根据实际,调整文件名称

2.1. [已不推荐]安装

安装 mamba 耗时较久,推荐刚安装 anaconda 时直接安装 mamba。

Installation — documentation: https://mamba.readthedocs.io/en/latest/installation.html

  1. 运行 conda activate base 进入 base 环境
  2. 运行 conda install mamba -n base -c conda-forge 安装 mamba

3. 使用

除了 activate, deactivate 外,mamba 使用和 conda 相同的命令和配置,例如

mamba install ...
mamba create -n ... -c ... ...
mamba list
conda activate ...

如果需要更加快速的查询库可以使用 mamba repoquery 命令

# will show you all available xtensor packages.
$ mamba repoquery search xtensor

# you can also specify more constraints on this search query
$ mamba repoquery search "xtensor>=0.18"

# will show you a list of the dependencies of xtensor.
$ mamba repoquery depends -t xtensor

4. 参考

  1. Anaconda | Understanding and Improving Conda’s performance: https://www.anaconda.com/blog/understanding-and-improving-condas-performance

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

零一魔法

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值