Micro/Mamba 安装与注意事项 #24
shenweiyan
announced in
1.3-折腾
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
记录一下 Micromamba/Mamba 安装的步骤和注意事项。
Mamba 安装
Mamba 可以使用 Mambaforge 方法和已有 Mini/conda 的方式安装,官方推荐的是前面一种,即使用 Mambaforge 进行全新安装。
全新安装
关于 mamba 的安装,官方推荐 Fresh install,即全新安装。
其实就是:
sh Mambaforge-Linux-x86_64.sh安装命令。在已有的 conda 中安装
官方文档中明确说不推荐这种安装 Mamba 的方式,他们强烈建议使用 Mambaforge 方法(见上文)。
这种方法,要获取
mamba,其实只需将其从conda-forge通道安装到基础环境中即可;但是需要注意 Installing mamba into any other environment than base is not supported,即不支持将 mamba 安装到 base 之外的任何其他环境中。首先,安装 Miniconda。
参考 https://docs.conda.io/en/latest/miniconda.html,下载完 Miniconda3-latest-Linux-x86_64.sh,sh 执行一下就可以安装了。
然后,安装 mamba。
Micromamba 安装
参考 https://mamba.readthedocs.io/en/latest/micromamba-installation.html。
脚本安装
如果您使用的是 macOS、Linux 或 Windows 上的 Git Bash,则有一种简单的安装方法
micromamba。只需在您喜欢的 shell 中执行安装脚本即可。对于 Linux、macOS 或 Windows 上的 Git Bash,请使用以下命令安装:
自动更新
安装后,
micromamba可以通过下面的方式更新:可以指定显式版本:
手动更新
Linux 和 macOS
下载并解压可执行文件(来自官方
conda-forge包)即可。确保安装了基本实用程序。我们需要
curl和tar并支持bzip2。此外,您还需要一个基于 glibc 的系统,例如 Ubuntu、Fedora 或 Centos(Alpine Linux 本身无法运行)。以下 magic URL 始终返回 micromamba 的最新可用版本,并且使用
tar自动提取bin/micromamba部分。提取完成后,我们就可以使用
micromamba二进制文件了。如果您想在临时用例中快速使用 micromamba,您可以运行:
这个 shell hook 会修改您的 shell 变量以包含 micromamba 命令。
如果您想保留这些更改,可以通过运行
./micromamba shell init ...自动将它们写入.bashrc(或.zshrc)。这还允许您选择自定义 MAMBA_ROOT_ENVIRONMENT,这是包和 repodata 缓存所在的位置。现在您可以激活基本环境并安装新软件包,或创建其他环境。
专有的 conda-forge 设置可以配置为:
Beta Was this translation helpful? Give feedback.
All reactions