macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

Minicondaの代わりにMiniforgeインストーラーを使ってcondaの環境を作る

2021 5/8  タイトル修正


Conda-forgeのMiniforgeレポジトリには、conda-forge に特化した Conda の最小インストーラーが用意されています。Miniforgeレポジトリは Miniconda と同等ですが、Conda-forge がデフォルトのチャンネルとして設定されています。また、様々な CPU アーキテクチャのサポートに重点を置いており、まだexperimental扱いではあるものの、Apple silicon向けのインストーラーも用意されています。さらに、Mambaをオプションでサポートしています。

 

今回は、提供されているインストーラスクリプトを使ってwindowsのWSL2にconda環境をセットアップします。

 

レポジトリ

Linuxmacosx86_64 (64 bit)とarm向け、LinuxのPOWER8/9向け、windowsx86_64)向けインストーラーが用意されています。2021年5月現在、pythonのバージョンは3.9になっています (base enviroment)。

 

f:id:kazumaxneo:20210507065404p:plain

Condaコマンドに加えてMambaも最初から使えるMambaバージョンも用意されています。今回はこちらを使います。

f:id:kazumaxneo:20210507065159p:plain

これらに加えて、PyPy 3.7がbase enviromentのインストーラーも用意されています(Github参照)。

 

ダウンロード

ここではmambaが初めから使えるMambaforgeインストーラーをダウンロードします。

#Apple silicon (M1 chip)
wget -O Mambaforge3.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-arm64.sh

#Apple x86_64 (Intel chip)
wget -O Mambaforge3.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh

#Linux x86_64
wget -O Mambaforge3.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh

#Linux ARM
wget -O Mambaforge3.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-aarch64.sh

windowsのWSLもLinux向けインストーラーを使います)

 

> bash Mambaforge3.sh -h

usage: Mambaforge3.sh [options]

 

Installs Mambaforge 4.10.1-0

 

#if has_license

-b run install in batch mode (without manual intervention),

it is expected the license terms are agreed upon

#else

-b run install in batch mode (without manual intervention)

#endif

-f no error if install prefix already exists

-h print this help message and exit

-p PREFIX install prefix, defaults to /home/kazu/mambaforge, must not contain spaces.

-s skip running pre/post-link/install scripts

-u update an existing installation

-t run package tests after installation (may install conda-build)

 

 

インストール

-b付きでバッチモード、-bなしでインタラクティブモードのインストールになります。-pでインストールパスを指定します。デフォルトはユーザーのホームのmambaforge下です。

bash Mambaforge3.sh -b

#アクティブにする
echo ". ~/mambaforge/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
#アクティベート
source ~/.bashrc
  • -b  run install in batch mode (without manual intervention)

> mamba 

f:id:kazumaxneo:20210507073330p:plain

導入できました。

 

引用

GitHub - conda-forge/miniforge: A conda-forge distribution.