美文网首页
Tools:micromamba替代miniconda

Tools:micromamba替代miniconda

作者: wo_monic | 来源:发表于2023-11-15 11:20 被阅读0次

conda安装各种软件很方便,但是现在依赖的解决越来越慢,而且会经常报错。miniconda是conda的精简版,mamba是conda的替代,micromamba是mamba的精简版。
四个工具的命令基本上是一致的,所以迁移完全无痛。

下载micromamaba

# Linux Intel (x86_64):
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
# Linux ARM64:
curl -Ls https://micro.mamba.pm/api/micromamba/linux-aarch64/latest | tar -xvj bin/micromamba
# Linux Power:
curl -Ls https://micro.mamba.pm/api/micromamba/linux-ppc64le/latest | tar -xvj bin/micromamba
# macOS Intel (x86_64):
curl -Ls https://micro.mamba.pm/api/micromamba/osx-64/latest | tar -xvj bin/micromamba
# macOS Silicon/M1 (ARM64):
curl -Ls https://micro.mamba.pm/api/micromamba/osx-arm64/latest | tar -xvj bin/micromamba

上面的命令会创建一个./bin/micromamba 的可执行文件。

添加到环境变量,并初始化mamba的root目录

# Linux/bash:
./bin/micromamba shell init -s bash -p ~/micromamba  # this writes to your .bashrc file
# sourcing the bashrc file incorporates the changes into the running session.
# better yet, restart your terminal!
source ~/.bashrc

alias mamba=micromamba也可以把这句添加到~/.bashrc,这样就可以直接使用mamba命令代替micromamba命令了。

配置channel,和conda一样,设置国内的清华源就行

上面初始化之后
编辑配置文件 vim ~/micromamba/.mambarc
把以下的内容添加到~/micromamba/.mambarc文件,并保存

channels:
  - defaults
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
custom_channels:
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
always_yes: true
auto_activate_base: false

测试是否安装配置成功

mamba create -n pytorch
mamba activate pytorch
mamba install pytorch

相关文章

网友评论

      本文标题:Tools:micromamba替代miniconda

      本文链接:https://www.haomeiwen.com/subject/lwyswdtx.html