Both sides previous revision Previous revision Next revision | Previous revision |
habrok:examples:mamba [2024/12/06 15:02] – fokke | habrok:examples:mamba [2024/12/12 07:21] (current) – [Manual Mamba initialization] fokke |
---|
====== Mamba installation ====== | ====== Mamba installation ====== |
| |
Mamba (https://mamba.readthedocs.io/en/latest/index.html) is an alternative to Anaconda, which is released under an open source license. In order to use it on Hábrók you can install it into your home directory. This can be done following the instructions on their website. There is an important *caveat*, however, which is that you should *NOT* let it start up the base environment on log in, as that would break any other Python software on the cluster. | Mamba (https://mamba.readthedocs.io/en/latest/index.html) is an alternative to Anaconda, which is released under an open source license. In order to use it on Hábrók you can install it into your home directory. This can be done following the instructions on their website. There is an important **caveat**, however, which is that you should **NOT** let it start up the base environment on log in, as that would break any other Python software on the cluster. |
| |
Here are the installation steps as of December 2024, which is based on the instructions on the website, which suggest to use miniforge ( https://github.com/conda-forge/miniforge#install): | In general Mamba and conda environments cannot be used together with **any** of our preinstalled software modules that depend on Python. |
- Run the miniforge installer | |
| Please also note, that you should only use mamba/conda repositories that have licenses that allow your intended usage. |
| |
| ==== Installation ==== |
| |
| Here are the installation steps (tested in December 2024), which are based on the instructions on the website, which suggest to use miniforge ( https://github.com/conda-forge/miniforge#install): |
| * Run the miniforge installer |
<code> | <code> |
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" | curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" |
bash Miniforge3-$(uname)-$(uname -m).sh | bash Miniforge3-$(uname)-$(uname -m).sh |
</code> | </code> |
- Check and if you agree say "yes" to the license conditions | * Check the license conditions, and if you agree say "yes" to these. |
- The software will be installed in a `miniforge3` folder in your home directory. Change this if you prefer a different location. | * The software will be installed in a ''miniforge3'' folder in your home directory. Change this, if you prefer a different location. Note that the instructions will assume you've opted for a ''miniforge3'' folder in your home directory. |
- You can opt for automatic initialization of conda, but you *must* disable the automatic activation of the base environment, as otherwise you will get conflicts with a lot of software that we provide on the cluster. Alternatively you can run an initialization command every time you want to use mamba. | * You can opt for automatic initialization of mamba, but you **must** disable the automatic activation of the base environment, as otherwise you will get conflicts with a lot of software that we provide on the cluster. Alternatively, you can run an initialization command every time you want to use mamba. |
- After logging in again, disable the automatic activation of the base environment using: | * After logging in again, disable the automatic activation of the base environment using: |
<code> | <code> |
conda config --set auto_activate_base false | mamba config --set auto_activate_base false |
| </code> |
| * In case you want to use the base environment, you can reactivate it using: |
| <code> |
| mamba activate base |
</code> | </code> |
| |
In order to undo the login profile modifications for mamba you can use: | ==== Manual Mamba initialization ==== |
| |
| In case you did **not** let Mamba change your login scripts during the installation, manual activation of the initial mamba/conda environment can be achieved using the following commands: |
<code> | <code> |
conda init --reverse $SHELL | . ~/miniforge3/etc/profile.d/conda.sh |
| . ~/miniforge3/etc/profile.d/mamba.sh |
</code> | </code> |
| Note that you have to run these every time you want to use Mamba. |
| |
| ==== Modifying the login profile ===== |
| |
| In order to undo the login profile modifications for mamba you can use the following command, where bash is your actual command line shell: |
| <code> |
| mamba init --reverse bash |
| </code> |
| |
| You can reverse the previous step, to have mamba available on login, using: |
| <code> |
| ~/miniforge3/bin/mamba init |
| </code> |
| |