Versions Compared

Key

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

This article will guide you to create an 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/2223.11.10-10.

Code Block
username@lanta:~> ml av MinicondaMamba
---------------------- /lustrefs/disk/modules/easybuild/modules/all -----------------------
   Miniconda3Mamba/2223.11.1-10-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.1-1
username@lanta:~>

...

0-0

Unload Mamba module

Use the

...

module unload Mamba command to unload the Mamba.

Code Block
username@lanta:~> condamodule env unload Mamba

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

Code Block
username@lanta:~> module purge
Note

Before you use the module unload Mamba 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.12.1 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.01         /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.12.1) 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
...
username@lanta:~> 
...

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.01.10 |9.19              h06a4308|h0755675_0_cpython        22.7 MB 120 KBconda-forge
    certifiwheel-20220.12.743.0               |    | pyhd8ed1ab_1   py39h06a4308_0       57 KB 150 KBconda-forge
    ------------------------------------------------------------
                                           Total:        22.8 MB

The following NEW packages will be INSTALLED:

   270 KB

The following NEW packages will be INSTALLED:

  _libgcc_mutex_libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu
  bzip2              pkgsconda-forge/main/linux-64::_libgcc_mutex-bzip2-1.0.18-mainhd590300_5
  _openmp_mutexca-certificates      pkgs/main/conda-forge/linux-64::_openmp_mutex-5.1-1_gnu
  ca-certificates    pkgs/mainca-certificates-2024.2.2-hbcca054_0
  ld_impl_linux-64   conda-forge/linux-64::ca-certificates-2023.01.10-h06a4308ld_impl_linux-64-2.40-h41732ed_0
  certifilibffi             pkgs/mainconda-forge/linux-64::certifilibffi-20223.124.72-py39h06a4308h7f98852_05
  ld_impl_linux-64libgcc-ng          pkgs/mainconda-forge/linux-64::ld_impl_linux-64-libgcc-ng-13.2.380-h1181459h807b86a_15
  libffilibgomp             pkgs/mainconda-forge/linux-64::libffilibgomp-313.42.20-h6a678d5_6h807b86a_5
  libnsl   libgcc-ng          pkgs/mainconda-forge/linux-64::libgcclibnsl-ng-11.2.0.1-h1234567hd590300_10
  libgomplibsqlite            pkgs/main/conda-forge/linux-64::libgomplibsqlite-113.45.2.0-h1234567_1h2797004_0
  libuuid     libstdcxx-ng       pkgs/mainconda-forge/linux-64::libstdcxxlibuuid-ng-112.238.01-h1234567h0b41bf4_10
  ncurseslibxcrypt            pkgs/main/conda-forge/linux-64::ncurseslibxcrypt-64.4.36-h6a678d5hd590300_01
  openssllibzlib            pkgsconda-forge/main/linux-64::openssllibzlib-1.12.1t13-h7f8727ehd590300_05
  pipncurses                pkgs/mainconda-forge/linux-64::pipncurses-226.34.120240210-py39h06a4308h59595ed_0
  pythonopenssl             pkgs/main/conda-forge/linux-64::pythonopenssl-3.92.161-h7a1cb2a_0hd590300_1
  pip     readline           pkgs/main/linux-64conda-forge/noarch::readlinepip-824.20-h5eee18bpyhd8ed1ab_0
  setuptoolspython             pkgsconda-forge/main/linux-64::setuptoolspython-653.69.319-py39h06a4308h0755675_0_cpython
  sqlitereadline             pkgs/main/conda-forge/linux-64::sqlitereadline-38.40.12-h5082296h8228510_01
  tksetuptools                 pkgs/main/linux-64::tk-8.6.12-h1ccaba5conda-forge/noarch::setuptools-69.2.0-pyhd8ed1ab_0
  tzdatatk                 pkgs/main/noarchconda-forge/linux-64::tzdata-2022g-h04d1e81_0tk-8.6.13-noxft_h4845f30_101
  wheeltzdata              pkgs/main/linux-64conda-forge/noarch::wheel-0.38.4-py39h06a4308tzdata-2024a-h0c530f3_0
  xzwheel                 pkgs/main/linux-64::xz-5.2.10-h5eee18b_1
  zlibconda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1
  xz                 pkgs/mainconda-forge/linux-64::zlibxz-15.2.136-h5eee18bh166bdaf_0

Proceed ([y]/n)? y
...
username@lanta:~> 

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

Code Block
username@lanta:~> conda create -n myenv python=3.9 numpy=1.23.5
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:
    - numpy=1.23.5
    - python=3.9


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    blas-1.0                   |              mkl           6 KB
    ca-certificates-2023.01.10 |-----
    libblas-3.9.0        h06a4308_0      |21_linux64_openblas   120 KB     certifi-2022.12.7 14 KB  conda-forge
     |   py39h06a4308_libcblas-3.9.0         150 KB     intel-openmp-2021.4.0      ||21_linux64_openblas    h06a4308_3561      14 KB  4.2 MBconda-forge
     mkl-2021.4libgfortran-ng-13.2.0      |       h69a702a_5  |     h06a4308_640   23 KB  conda-forge
142.6 MB     mkl-service-2.4liblapack-3.9.0          |   py39h7f8727e_0|21_linux64_openblas          5914 KB  conda-forge
    mkl_fftnumpy-1.323.15               |   py39hd3c417cpy39h3d75532_00         5.6 MB 182 KBconda-forge
    mkl_randompython-13.29.219           |   py39h51133e4|h0755675_0_cpython        22.7 MB 309 KBconda-forge
    numpypython_abi-1.23.53.9             |        |   py39h14f42284_0cp39           106 KB  conda-forge
    numpywheel-base-10.23.543.0               |   py39h31eccc5_0  pyhd8ed1ab_1          57 KB 6.7 MB conda-forge
    ------------------------------------------------------------
                                           Total:        28.4 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu
  bzip2   Total:       154.3 MB  The following NEW packages will be INSTALLED:

  _libgcc_mutex      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_libgccimpl_mutexlinux-64-02.1-main40-h41732ed_0
  libblas      _openmp_mutex      pkgsconda-forge/main/linux-64::_openmp_mutex-5.1-1_gnulibblas-3.9.0-21_linux64_openblas
  blaslibcblas               pkgs/mainconda-forge/linux-64::blaslibcblas-13.9.0-mkl21_linux64_openblas
  libffi         ca-certificates    pkgsconda-forge/main/linux-64::calibffi-certificates-20233.014.102-h06a4308h7f98852_05
  certifilibgcc-ng            pkgs/mainconda-forge/linux-64::certifilibgcc-ng-202213.122.70-py39h06a4308h807b86a_05
  intellibgfortran-openmpng       pkgs/mainconda-forge/linux-64::intellibgfortran-openmpng-202113.42.0-h06a4308_3561h69a702a_5
  libgfortran5    ld_impl_linux-64   pkgsconda-forge/main/linux-64::ld_impl_linux-64-libgfortran5-13.2.380-h1181459ha4646dd_1
5
 libffi libgomp            pkgs/mainconda-forge/linux-64::libffilibgomp-313.42.20-h6a678d5h807b86a_65
  libgcc-ngliblapack          pkgsconda-forge/main/linux-64::libgccliblapack-ng-113.29.0-h1234567_121_linux64_openblas
  libnsl libgomp            pkgs/mainconda-forge/linux-64::libgomplibnsl-11.2.0.1-h1234567hd590300_10
  libstdcxx-nglibopenblas        pkgsconda-forge/main/linux-64::libstdcxxlibopenblas-ng-110.23.026-h1234567pthreads_h413a1c8_10
  mkllibsqlite                pkgs/main/conda-forge/linux-64::mkllibsqlite-20213.445.02-h06a4308h2797004_6400
  mkllibstdcxx-serviceng        pkgs/mainconda-forge/linux-64::mkllibstdcxx-serviceng-13.2.4.0-py39h7f8727eh7e041cc_05
  mkl_fftlibuuid            pkgsconda-forge/main/linux-64::mkl_fftlibuuid-12.338.1-py39hd3c417ch0b41bf4_0
  libxcrypt mkl_random         pkgs/mainconda-forge/linux-64::mkl_randomlibxcrypt-14.24.236-py39h51133e4hd590300_01
  ncurseslibzlib            pkgsconda-forge/main/linux-64::ncurseslibzlib-61.2.413-h6a678d5hd590300_05
  numpyncurses              pkgs/mainconda-forge/linux-64::numpyncurses-16.234.520240210-py39h14f4228h59595ed_0
  numpy-base              pkgs/mainconda-forge/linux-64::numpy-base-1.23.5-py39h31eccc5py39h3d75532_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.16-h7a1cb2a_0
  readline           pkgs/main/linux-64::readline-8.2-h5eee18b_0
  setuptools19-h0755675_0_cpython
  python_abi         pkgsconda-forge/main/linux-64::setuptoolspython_abi-653.6.39-py39h06a43084_0cp39
  sixreadline                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0conda-forge/linux-64::readline-8.2-h8228510_1
  sqlitesetuptools             pkgs/main/linux-64::sqlite-3.40.1-h5082296conda-forge/noarch::setuptools-69.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.3843.4-py39h06a4308_0
  xz                 pkgs/main/linux-64::xz-5.2.10-h5eee18b-pyhd8ed1ab_1
  zlibxz                 pkgs/mainconda-forge/linux-64::zlibxz-15.2.136-h5eee18bh166bdaf_0

Proceed ([y]/n)? y
...
username@lanta:~>

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
...
username@lanta:~>

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
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (current_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 MB 120 KBconda-forge
    certifiwheel-20220.12.743.0               |   py39h06a4308_0  pyhd8ed1ab_1          15057 KB  conda-forge
    ----------------------------------------------------------------------
                                           Total:        22.8 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      Total:conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      270 KB

The following NEW packages will be INSTALLED: conda-forge/linux-64::_openmp_mutex-4.5-2_gnu
  bzip2        _libgcc_mutex      pkgsconda-forge/main/linux-64::_libgcc_mutex-bzip2-1.0.18-mainhd590300_5
  _openmp_mutexca-certificates      pkgs/mainconda-forge/linux-64::_openmp_mutex-5.1-1_gnu
  ca-certificates    pkgs/main/ca-certificates-2024.2.2-hbcca054_0
  ld_impl_linux-64   conda-forge/linux-64::ca-certificates-2023.01.10-h06a4308_0
  certifild_impl_linux-64-2.40-h41732ed_0
  libffi             pkgsconda-forge/main/linux-64::certifilibffi-20223.124.72-py39h06a4308h7f98852_05
  ld_impl_linux-64libgcc-ng          pkgsconda-forge/main/linux-64::ld_impl_linux-64-libgcc-ng-13.2.380-h1181459h807b86a_15
  libffilibgomp             pkgs/main/conda-forge/linux-64::libffilibgomp-313.42.20-h6a678d5_6h807b86a_5
  libnsl   libgcc-ng          pkgsconda-forge/main/linux-64::libgcc-nglibnsl-11.2.0.1-h1234567hd590300_10
  libgomplibsqlite            pkgs/mainconda-forge/linux-64::libgomplibsqlite-113.45.2.0-h1234567_1-h2797004_0
  libuuid     libstdcxx-ng       pkgs/mainconda-forge/linux-64::libstdcxxlibuuid-ng-112.238.01-h1234567h0b41bf4_10
  ncurseslibxcrypt            pkgs/main/conda-forge/linux-64::ncurseslibxcrypt-64.4.36-h6a678d5hd590300_01
  openssllibzlib            pkgs/mainconda-forge/linux-64::openssllibzlib-1.12.1t13-h7f8727ehd590300_05
  pipncurses                pkgs/mainconda-forge/linux-64::pipncurses-226.34.120240210-py39h06a4308h59595ed_0
  pythonopenssl             pkgs/main/conda-forge/linux-64::pythonopenssl-3.92.161-h7a1cb2a_0hd590300_1
  pip     readline           pkgs/main/linux-64conda-forge/noarch::readlinepip-824.20-h5eee18bpyhd8ed1ab_0
  python  setuptools           pkgs/mainconda-forge/linux-64::setuptoolspython-653.69.319-py39h06a4308h0755675_0
_cpython
 sqlite readline            pkgs/main/conda-forge/linux-64::sqlitereadline-38.40.12-h5082296h8228510_01
  tksetuptools                 pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0
  tzdataconda-forge/noarch::setuptools-69.2.0-pyhd8ed1ab_0
  tk                 pkgs/main/noarchconda-forge/linux-64::tzdata-2022g-h04d1e81_0tk-8.6.13-noxft_h4845f30_101
  wheeltzdata              pkgs/main/linux-64conda-forge/noarch::wheel-0.38.4-py39h06a4308tzdata-2024a-h0c530f3_0
  xzwheel                 pkgs/main/linux-64::xz-5.2.10-h5eee18b_1
  zlibconda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1
  xz                 pkgsconda-forge/main/linux-64::zlibxz-15.2.136-h5eee18bh166bdaf_0

Proceed ([y]/n)? y
...
username@lanta:~>

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 fileyml 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
username@lanta:~>

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
username@lanta:~>

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
username@lanta:~>

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
username@lanta:~>

...

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