You must avoid using conda through the Anaconda or Miniconda distributions, as you may run into licensing issues. Access to Anaconda’s public repository of packages is only free to individuals and small organisations (<200 employees). A paid license is required for larger organisations and anyone embedding or mirroring Anaconda’s repository. See Anaconda's Terms of Service for details.
If you have any installation of Anaconda or Miniconda, or any conda environment using packages from Anaconda's default channels, you must remove them and recreate your environments using an alternative method. Fortunately, there are community-driven channels such as conda-forge, which is completely independent from Anaconda and not bound to their Terms of Service. There are also alternative conda package manager distributions, such as Miniforge, that can be used without breaching those Terms of Service.
Access to Anaconda licensed resources is blocked from all ECMWF platforms to avoid accidental use of those.
If working on ECMWF's Atos HPCF or ECS, you may (in order of preference):
- Use tykky, which uses Miniforge internally to create a containerised environment. It may give you the best performance results.
- Use provided conda module, which is based on Miniforge. Note, however, that resulting environments on shared filesystems such PERM may suffer from slow performance.
- Install Miniforge on your own space. This option is discouraged in favour of above alternatives, and only to be used only if those solutions cannot satisfy your requirements.
If working on personal laptops of or any other ECMWF computing platform, including the European Weather Cloud:
- Install Miniforge if not already installed and migrate your environments. Once done, remove the previous anaconda or miniconda installation.
Miniforge as an alternative
Miniforge provides the minimal installers for Conda and Mamba specific to conda-forge, with the following features pre-configured:
- Packages in the base environment are obtained from the conda-forge channel.
- The conda-forge channel is set as the default (and only) channel.
Check below for instructions on what to do to detect and migrate existing environments to alternative solutions.
How to check if any of my installations or environments are using Anaconda-licensed packages
You may use the conda_licensed_envs
command-line tool to see if any of your environments may be using Anaconda-licensed packages. The tool is available:
- On ECMWF's Atos HPCF or ECS, running:
/usr/local/apps/conda/conda_licensed_envs
- On any other UNIX-based platform (Linux, Mac or Windows Subsystem for Linux - WSL) platform, downloading conda_licensed_envs and running it in your terminal.
- On Windows, downloading conda_licensed_envs.ps1 and run it in your Windows Terminal or PowerShell.
Checking manually
Here are the main steps you can manually take to check whether you may be using an Anaconda licensed product:
- if using your own installation, check LICENSE or LICENSE.txt file at the root of the installation. If they contain the Anaconda Terms of Service, then you are using Anaconda's distribution and are subject to their Terms of Service.
- For existing environments run:If any of the packages come from https://repo.anaconda.com/pkgs then the environment is using Anaconda's own channels, subject to Anaconda's Terms of Service.
conda list --explicit -n <environment_name>
- If "defaults" is in the list of channels of the environment or in your ~/.condarc, then packages subject to Anaconda's Terms of Service may be used.
How to migrate anaconda/miniconda environments
Packages from default conda channels and the community channel conda-forge are different and not compatible. Therefore a standard environment export will not work out of the box.
Generate a safe environment yaml file
You may use the conda_export
command-line can help you export an existing environment using default Anaconda channels into one without it, using conda-forge as replacement. It will export the environment from history, but preserving the same package versions installed including those installed through pip. The tool is available:
- On ECMWF's Atos HPCF or ECS, running:
/usr/local/apps/conda/conda_exporter my_env > my_env.yml
- On any other platform, downloading conda_exporter and running it in your terminal.
- In order for it to work, these are the requirements:
- Python 3.6 or above
- Pyyaml python package, which can usually be installed with
pip install pyyaml
if not available. - a working conda installation.
- In order for it to work, these are the requirements:
Export limitations
Since packages in conda-forge are different from those in Anaconda repositories, the generated environment YAML file may not be able to fully reproduce your original environment. Always check the resulting environment and test if the exported one works for your use case.
In some instances, you might need to recreate the environment from scratch.
Create a new containerised environment with Tykky on Atos HPCF or ECS
Standard conda environments may perform poorly when installed on shared filesystems like the ones on the HPCF, and may create significant pressure on the filesystem infrastructure as a whole, and ultimately causing an overall service degradation. For that reason, the use of containerised software installations with Tykky is recommended.
In a nutshell, once you have the environment description in a YAML file, you can create an environment and use it like this:
ml tykky conda-containerize new --mamba --prefix=$TYKKY_PATH/my_env my_env.yml tykky activate my_env
Create a new conda environment with Miniforge on Atos HPCF or ECS
If the above method does not work for you on Atos HPCF or ECS you may use the provided conda module which is based on Miniforge. See HPC2020: Conda at ECMWF
ml conda conda env create -f my_env.yml -n myenv conda activate my_env
Using mamba
You may alternatively use mamba as a replacement for conda which may speed up the creation of the environment
ml conda mamba env create -f my_env.yml -n myenv mamba activate my_env
Create a new conda environment with Miniforge on any other platform
You may install Miniforge on your own platform such as a laptop, a container or a Virtual Machine following the instructions in Getting started with Conda.
Once installed and initialised, you just need to create the new environment and activate it
conda env create -f my_env.yml -n myenv conda activate my_env
Using mamba
You may alternatively use mamba as a replacement for conda which may speed up the creation of the environment
mamba env create -f my_env.yml -n myenv mamba activate my_env