Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article will guide you to create the environment using Miniconda on a LANTA HPC system. An overview of the content can be found in the table of contents below for immediate visualization of the interesting parts.

Table of Contents

Using

...

Mamba on LANTA HPC

Load

...

Mamba module

  1. Use the ml av MinicondaMamba command to see which version of Miniconda Mamba is available on the LANTA HPC system.

  2. Use the ml Miniconda3Mamba/xx.xx.x command to load the Miniconda Mamba version that you want to use. If you don't specify a version, the default version (D) is loaded, which is Miniconda3Mamba/23.311.10-0.

Code Block
username@lanta:~> ml av MinicondaMamba
---------------------- /lustrefs/disk/modules/easybuild/modules/all -----------------------
   Miniconda3Mamba/2223.11.1-1    Miniconda3/23.3.1-0-0 (D)

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
username@lanta:~> ml Miniconda3Mamba/2223.11.10-10

Unload

...

Mamba module

Use the module unload Miniconda3Mamba command to unload the MinicondaMamba.

Code Block
username@lanta:~> module unload Miniconda3Mamba

Use the module purge command to unload all currently loaded modules.

...

Note

Before you use the module unload Miniconda3Mamba or module purge command, you must deactivate your environment with the conda deactivate command.

Activate your environment

  1. Use the conda env list command to view a list of your environments.

  2. If you want to activate your environment such as TensorFlow-2.6.0, you can use the conda activate tensorflow-2.612.01 command.

Code Block
username@lanta:~> conda env list
# conda environments:
#
base                     /lustrefs/disk/modules/easybuild/software/Miniconda3Mamba/2223.11.10-10
netcdf-py39              /lustrefs/disk/modules/easybuild/software/Miniconda3Mamba/2223.11.10-10/envs/netcdf-py39
pytorch-12.112.02            /lustrefs/disk/modules/easybuild/software/Miniconda3Mamba/2223.11.10-10/envs/pytorch-12.112.02
tensorflow-2.612.0 1        /lustrefs/disk/modules/easybuild/software/Miniconda3Mamba/2223.11.10-10/envs/tensorflow-2.612.01
username@lanta:~> conda activate tensorflow-2.612.01
(tensorflow-2.612.01) username@lanta:~>

Deactivate your environment

Use the conda deactivate command to deactivate your environments.

Code Block
(tensorflow-2.612.01) username@lanta:~> conda deactivate
username@lanta:~>

Creating the environment in the user’s home

Create the environment

Use the conda create -n myenv commands to create the environment with myenv name.

Code Block
username@lanta:~> conda create -n myenv
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /your directory/envs/myenv

Proceed ([y]/n)? y
...

Create the environment with a specific version of the packages

Use the conda create -n myenv python=3.9 commands to create the myenv environment with a specific version of python.

Code Block
username@lanta:~> conda create -n myenv python=3.9
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /your directory/envs/myenv

  added / updated specs:
    - python=3.9


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    capython-certificates-20233.019.1019 |       h06a4308_0      |h0755675_0_cpython   120 KB     certifi-2022.12.22.7 MB  conda-forge
      |wheel-0.43.0               |    py39h06a4308 pyhd8ed1ab_01          15057 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        22.8 270MB
KB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/mainconda-forge/linux-64::_libgcc_mutex-0.1-mainconda_forge
  _openmp_mutex      pkgs/mainconda-forge/linux-64::_openmp_mutex-4.5.1-12_gnu
  bzip2   ca-certificates       pkgs/main/linux-    conda-forge/linux-64::cabzip2-certificates-20231.010.108-h06a4308hd590300_05
  certifica-certificates            pkgs/main/conda-forge/linux-64::certifica-certificates-20222024.122.72-py39h06a4308hbcca054_0
  ld_impl_linux-64   pkgsconda-forge/main/linux-64::ld_impl_linux-64-2.3840-h1181459h41732ed_10
  libffi             pkgsconda-forge/main/linux-64::libffi-3.4.2-h6a678d5h7f98852_65
  libgcc-ng          pkgsconda-forge/main/linux-64::libgcc-ng-1113.2.0-h1234567h807b86a_15
  libgomp            pkgs/mainconda-forge/linux-64::libgomp-1113.2.0-h1234567_1h807b86a_5
  libnsl      libstdcxx-ng       pkgs/mainconda-forge/linux-64::libstdcxxlibnsl-ng-11.2.0.1-h1234567hd590300_10
  ncurseslibsqlite            pkgs/main/conda-forge/linux-64::ncurseslibsqlite-63.45.42-h6a678d5h2797004_0
  openssllibuuid            pkgsconda-forge/main/linux-64::openssllibuuid-12.38.1.1t-h7f8727eh0b41bf4_0
  piplibxcrypt                pkgs/mainconda-forge/linux-64::piplibxcrypt-224.34.136-py39h06a4308hd590300_01
  pythonlibzlib             pkgs/main/conda-forge/linux-64::pythonlibzlib-31.92.1613-h7a1cb2ahd590300_05
  ncurses readline           pkgsconda-forge/main/linux-64::readlinencurses-86.4.220240210-h5eee18bh59595ed_0
  setuptoolsopenssl           pkgs/main conda-forge/linux-64::setuptoolsopenssl-653.62.31-py39h06a4308_0hd590300_1
  pip   sqlite             pkgs/main/linux-64conda-forge/noarch::sqlitepip-324.40.10-h5082296pyhd8ed1ab_0
  tkpython                 pkgs/mainconda-forge/linux-64::tkpython-83.69.1219-h1ccaba5h0755675_0_cpython
  tzdatareadline             pkgs/main/noarchconda-forge/linux-64::tzdatareadline-2022g8.2-h04d1e81h8228510_01
  wheelsetuptools              pkgs/main/linux-64::wheel-0.38.4-py39h06a4308conda-forge/noarch::setuptools-69.2.0-pyhd8ed1ab_0
  xztk                 pkgs/mainconda-forge/linux-64::xztk-58.26.1013-h5eee18bnoxft_h4845f30_1101
  zlibtzdata               pkgs/main/linux-64conda-forge/noarch::zlib-1.2.13-h5eee18btzdata-2024a-h0c530f3_0
  wheel              conda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0

Proceed ([y]/n)? y
...

...

Code Block
username@lanta:~> conda create -n myenv python=3.9 numpy=1.23.5
CollectingChannels:
 - conda-forge
Platform: linux-64
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /your directory/envs/myenv

  added / updated specs:
    - numpy=1.23.5
    - python=3.9


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    blaslibblas-13.9.0                   |21_linux64_openblas          14 KB  conda-forge
mkl    libcblas-3.9.0       6 KB     ca-certificates-2023.01.10 ||21_linux64_openblas       h06a4308_0   14 KB  conda-forge
  120 KB
    certifi-2022.12.7 libgfortran-ng-13.2.0      |    |   py39h06a4308h69a702a_05          15023 KB  conda-forge
    intelliblapack-openmp-20213.49.0        |    h06a4308_3561|21_linux64_openblas          14 KB 4.2 MB conda-forge
    mklnumpy-20211.423.05               |   py39h3d75532_0  h06a4308_640       1425.6 MB  conda-forge
  mkl-service-2.4.0  python-3.9.19           |   py39h7f8727e|h0755675_0_cpython        22.7 MB 59 KBconda-forge
    mklpython_fftabi-1.3.19              |   py39hd3c417c_0        4_cp39 182 KB     mkl_random-1.2.2    6 KB  conda-forge
   |   py39h51133e4_ wheel-0.43.0         309 KB     numpy-1.23.5|     pyhd8ed1ab_1          |   py39h14f4228_0          10 57 KB     numpy-base-1.23.5     conda-forge
    |   py39h31eccc5_0         6.7 MB
    ------------------------------------------------------------
                                           Total:       154 28.34 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgsconda-forge/main/linux-64::_libgcc_mutex-0.1-mainconda_forge
  _openmp_mutex      pkgsconda-forge/main/linux-64::_openmp_mutex-4.5.1-12_gnu
  blasbzip2               pkgs/main/conda-forge/linux-64::blasbzip2-1.0.8-mklhd590300_5
  ca-certificates    pkgsconda-forge/main/linux-64::ca-certificates-20232024.012.102-h06a4308hbcca054_0
  certifild_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.40-h41732ed_0
  libblas      pkgs/main      conda-forge/linux-64::certifilibblas-20223.129.70-py39h06a4308_021_linux64_openblas
  libcblas    intel-openmp       pkgs/mainconda-forge/linux-64::intellibcblas-openmp-20213.49.0-h06a4308_356121_linux64_openblas
  libffi          ld_impl_linux-64   pkgsconda-forge/main/linux-64::ld_impl_linux-64-2.38-h1181459_1libffi-3.4.2-h7f98852_5
  libffilibgcc-ng             pkgs/mainconda-forge/linux-64::libffilibgcc-ng-313.42.20-h6a678d5h807b86a_65
  libgcclibgfortran-ng          pkgs/mainconda-forge/linux-64::libgcclibgfortran-ng-1113.2.0-h1234567h69a702a_15
  libgomplibgfortran5            pkgs/main/conda-forge/linux-64::libgomplibgfortran5-1113.2.0-h1234567_1ha4646dd_5
  libgomp     libstdcxx-ng       pkgs/mainconda-forge/linux-64::libstdcxxlibgomp-ng-1113.2.0-h1234567h807b86a_15
  mklliblapack                pkgs/main/conda-forge/linux-64::mklliblapack-20213.49.0-h06a4308_64021_linux64_openblas
  libnsl     mkl-service        pkgsconda-forge/main/linux-64::mkllibnsl-service-2.40.01-py39h7f8727ehd590300_0
  mkl_fftlibopenblas            pkgs/main/conda-forge/linux-64::mkl_fftlibopenblas-10.3.126-py39hd3c417cpthreads_h413a1c8_0
  libsqlite mkl_random         pkgs/mainconda-forge/linux-64::mkl_randomlibsqlite-13.245.2-py39h51133e4h2797004_0
  ncurseslibstdcxx-ng            pkgs/main/conda-forge/linux-64::ncurses-6.4-h6a678d5_0libstdcxx-ng-13.2.0-h7e041cc_5
  numpylibuuid              pkgs/mainconda-forge/linux-64::numpylibuuid-12.2338.51-py39h14f4228h0b41bf4_0
  numpy-baselibxcrypt          pkgs/mainconda-forge/linux-64::numpylibxcrypt-base-14.234.536-py39h31eccc5hd590300_01
  openssllibzlib            pkgsconda-forge/main/linux-64::openssllibzlib-1.12.1t13-h7f8727ehd590300_05
  pipncurses                pkgs/main/conda-forge/linux-64::pipncurses-226.34.120240210-py39h06a4308h59595ed_0
  pythonnumpy              pkgs/mainconda-forge/linux-64::pythonnumpy-31.923.165-h7a1cb2apy39h3d75532_0
  readlineopenssl            pkgs/mainconda-forge/linux-64::readlineopenssl-83.2.1-h5eee18b_0hd590300_1
  pip       setuptools         pkgs/main/linux-64conda-forge/noarch::setuptoolspip-6524.6.30-py39h06a4308pyhd8ed1ab_0
  sixpython                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
  sqliteconda-forge/linux-64::python-3.9.19-h0755675_0_cpython
  python_abi             pkgs/main/conda-forge/linux-64::sqlitepython_abi-3.40.19-h50822964_0cp39
  tkreadline                 pkgs/main/conda-forge/linux-64::tkreadline-8.6.122-h1ccaba5h8228510_01
  tzdatasetuptools             pkgs/main/conda-forge/noarch::tzdata-2022g-h04d1e81_0setuptools-69.2.0-pyhd8ed1ab_0
  tk   wheel              pkgsconda-forge/main/linux-64::wheeltk-08.386.413-py39h06a4308noxft_h4845f30_0101
  xztzdata                 pkgs/main/linux-64::xz-5.2.10-h5eee18b_1
  zlibconda-forge/noarch::tzdata-2024a-h0c530f3_0
  wheel               pkgs/main/linux-64::zlib-1.2.13-h5eee18bconda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0

Proceed ([y]/n)? y
...

Creating the environment in the project’s home

Specify a location for the environment

Use the conda create --prefix /your project directory/envs commands to create the environment on the specific location.

Code Block
username@lanta:~> conda create --prefix /your project directory/envs
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /your project directory/envs

Proceed ([y]/n)? y
...

Specify a location for the environment with a specific version of a package

Use the conda create --prefix /your project directory/envs python=3.9 commands to create the environment with a specific version of a package on a specific location.

Code Block
username@lanta:~> conda create --prefix /your project directory/envs python=3.9
CollectingChannels:
 package- metadata (current_repodataconda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /your project directory/envs

  added / updated specs:
    - python=3.9

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    capython-certificates-20233.01.10 |9.19              h06a4308|h0755675_0_cpython        22.7 120 KBMB  conda-forge
    certifiwheel-20220.12.743.0               |   py39h06a4308_0  pyhd8ed1ab_1          15057 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        22.8 270MB
KB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgsconda-forge/main/linux-64::_libgcc_mutex-0.1-mainconda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu
  bzip2   pkgs/main/           conda-forge/linux-64::bzip2-1.0.8-hd590300_5
  ca-certificates    conda-forge/linux-64::ca-certificates-2024.2.2-hbcca054_0
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.40-h41732ed_0
  libffi             conda-forge/linux-64::_openmp_mutex-5.1-1_gnulibffi-3.4.2-h7f98852_5
  ca-certificateslibgcc-ng          pkgsconda-forge/main/linux-64::calibgcc-certificatesng-202313.012.100-h06a4308h807b86a_05
  certifilibgomp            pkgs/mainconda-forge/linux-64::certifilibgomp-202213.122.70-py39h06a4308_0h807b86a_5
  libnsl          ld_impl_linux-64   pkgsconda-forge/main/linux-64::ld_impl_linux-64libnsl-2.380.1-h1181459hd590300_10
  libffilibsqlite             pkgs/main/conda-forge/linux-64::libffilibsqlite-3.445.2-h6a678d5h2797004_60
  libuuid  libgcc-ng          pkgsconda-forge/main/linux-64::libgcclibuuid-ng-112.238.01-h1234567h0b41bf4_10
  libgomplibxcrypt            pkgs/mainconda-forge/linux-64::libgomplibxcrypt-114.24.036-h1234567hd590300_1
  libzlib     libstdcxx-ng       pkgs/mainconda-forge/linux-64::libstdcxxlibzlib-ng-111.2.013-h1234567hd590300_15
  ncurses            pkgsconda-forge/main/linux-64::ncurses-6.4.20240210-h6a678d5h59595ed_0
  openssl            pkgsconda-forge/main/linux-64::openssl-13.2.1.1t-h7f8727ehd590300_01
  pip                pkgs/main/linux-64conda-forge/noarch::pip-2224.3.10-py39h06a4308pyhd8ed1ab_0
  python             pkgsconda-forge/main/linux-64::python-3.9.1619-h7a1cb2ah0755675_0_cpython
  readline           pkgs/mainconda-forge/linux-64::readline-8.2-h5eee18bh8228510_01
  setuptools         pkgs/main/linux-64conda-forge/noarch::setuptools-65.6.3-py39h06a4308_0
  sqlite             pkgs/main/linux-64::sqlite-3.40.1-h508229669.2.0-pyhd8ed1ab_0
  tk                 pkgs/mainconda-forge/linux-64::tk-8.6.1213-h1ccaba5noxft_h4845f30_0101
  tzdata             pkgs/mainconda-forge/noarch::tzdata-2022g2024a-h04d1e81h0c530f3_0
  wheel              pkgs/main/linux-64conda-forge/noarch::wheel-0.38.4-py39h06a4308_0
  xz                 pkgs/main/linux-64::xz-5.2.10-h5eee18b_1
  zlib.43.0-pyhd8ed1ab_1
  xz                 pkgs/mainconda-forge/linux-64::zlibxz-15.2.136-h5eee18bh166bdaf_0

Proceed ([y]/n)? y
...

Activate your environment in the project’s home

If you want to activate your environment in the project’s home, you can use the conda activate /your project directory/envs command.

Code Block
username@lanta:~> conda activate /your project directory/envs
(/your project directory/envs) username@lanta:~>

Creating the environment from an requirements.yml file

A simple requirements.yml file

In the requirements.yml file, you need to specify the environment name and packages that you want to use.

Code Block
name: envs
dependencies:
  - python=3.9
  - numpy=1.23.5
  - pandas

Create the environment from the requirements.yml file in the user’s home

Use the conda env create -f requirements.yml commands to create the environment from the requirements.yml file in the user’s home.

Code Block
username@lanta:~> conda env create -f requirements.yml
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Create the environment from the requirements.yml file in the project’s home

Use the conda env create -f requirements.yml --prefix /your project directory/envs commands to create the environment from the requirements.yml file on the specific location.

Code Block
username@lanta:~> conda env create -f requirements.yml --prefix /your project directory/envs
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Removing the environment

Remove the environment in the user’s home

If you want to remove the myenv environment, you can use the conda remove --name myenv --all command.

Code Block
username@lanta:~> conda remove --name myenv --all

Remove the environment in the project’s home

If you want to remove the environment in /your project directory/envs, you can use the rm -rf /your project directory/envs command.

Code Block
username@lanta:~> rm -rf /your project directory/envs

...

Related articles

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@48ae393
showSpacefalse
sortmodified
showSpacetypefalsepage
reversetrue
typelabelspagesingularity python container
cqllabel in ( "vir-env" , "python-script" , "jupyter" ) and space = currentSpace ( )labelssingularity python container