Restore / Save Conda/Micromamba Environments¶
Sometimes it just works and you do not want to change anything.
This is when you can create an environment file and safe your current python installed packges and versions.
What you can do:
- Backup an existing environment
- Restore an environment
- Design an environment
Backup¶
It is a good choice to create a backup of a working environment. Regardless if you plan on setting it up somewhere else or not.
!module list
Currently Loaded Modulefiles: 1) micromamba/2.2.0 >
# Check What environment are present
# Typically there are some root installed environments
!micromamba env list
Name Active Path ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base * /jetfs/home/yourusername/micromamba modern /jetfs/home/yourusername/micromamba/envs/modern /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda2-2019.10-5pou6jiel7heivyyjwlgwcyltniipjlp /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2019.10-tmy5mgp3gzy7uqkouhm33gfyp3p3xpsu /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2020.07-weugqkfkxd6zmn2irm7lpmujzczwebiw /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda2-4.7.12.1-zduqggvbh63zrdghrlty4ncwiclobaja /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda3-4.8.2-3m7b6t2kgedyr3jnd2nasmgiq7wm27iv
We want to backup the modern environment.
# Check What is installed inside your environment
!micromamba list -n modern
List of packages in environment: "/jetfs/home/yourusername/micromamba/envs/modern" Name Version Build Channel ───────────────────────────────────────────────────────────────────────────────────── _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge asttokens 3.0.0 pyhd8ed1ab_1 conda-forge aws-c-auth 0.8.1 h205f482_0 conda-forge aws-c-cal 0.8.1 h1a47875_3 conda-forge aws-c-common 0.10.6 hb9d3cd8_0 conda-forge aws-c-compression 0.3.0 h4e1184b_5 conda-forge aws-c-event-stream 0.5.0 h7959bf6_11 conda-forge aws-c-http 0.9.2 hefd7a92_4 conda-forge aws-c-io 0.15.3 h173a860_6 conda-forge aws-c-mqtt 0.11.0 h11f4f37_12 conda-forge aws-c-s3 0.7.9 he1b24dc_1 conda-forge aws-c-sdkutils 0.2.2 h4e1184b_0 conda-forge aws-checksums 0.2.2 h4e1184b_4 conda-forge aws-crt-cpp 0.29.9 he0e7f3f_2 conda-forge aws-sdk-cpp 1.11.489 h4d475cb_0 conda-forge azure-core-cpp 1.14.0 h5cfcd09_0 conda-forge azure-identity-cpp 1.10.0 h113e628_0 conda-forge azure-storage-blobs-cpp 12.13.0 h3cf044e_1 conda-forge azure-storage-common-cpp 12.8.0 h736e048_1 conda-forge azure-storage-files-datalake-cpp 12.12.0 ha633028_1 conda-forge bokeh 3.6.3 pyhd8ed1ab_0 conda-forge brotli-python 1.1.0 py312h2ec8cdc_2 conda-forge bzip2 1.0.8 h4bc722e_7 conda-forge c-ares 1.34.4 hb9d3cd8_0 conda-forge ca-certificates 2025.1.31 hbcca054_0 conda-forge certifi 2024.12.14 pyhd8ed1ab_0 conda-forge cffi 1.17.1 py312h06ac9bb_0 conda-forge click 8.1.8 pyh707e725_0 conda-forge cloudpickle 3.1.1 pyhd8ed1ab_0 conda-forge contourpy 1.3.1 py312h68727a3_0 conda-forge crc32c 2.7.1 py312h66e93f0_0 conda-forge cytoolz 1.0.1 py312h66e93f0_0 conda-forge dask 2025.1.0 pyhd8ed1ab_0 conda-forge dask-core 2025.1.0 pyhd8ed1ab_0 conda-forge decorator 5.1.1 pyhd8ed1ab_1 conda-forge deprecated 1.2.18 pyhd8ed1ab_0 conda-forge distributed 2025.1.0 pyhd8ed1ab_0 conda-forge donfig 0.8.1.post1 pyhd8ed1ab_1 conda-forge exceptiongroup 1.2.2 pyhd8ed1ab_1 conda-forge executing 2.1.0 pyhd8ed1ab_1 conda-forge freetype 2.12.1 h267a509_2 conda-forge fsspec 2025.2.0 pyhd8ed1ab_0 conda-forge gflags 2.2.2 h5888daf_1005 conda-forge glog 0.7.1 hbabe93e_0 conda-forge h2 4.2.0 pyhd8ed1ab_0 conda-forge hpack 4.1.0 pyhd8ed1ab_0 conda-forge hyperframe 6.1.0 pyhd8ed1ab_0 conda-forge importlib-metadata 8.6.1 pyha770c72_0 conda-forge ipython 8.32.0 pyh907856f_0 conda-forge jedi 0.19.2 pyhd8ed1ab_1 conda-forge jinja2 3.1.5 pyhd8ed1ab_0 conda-forge keyutils 1.6.1 h166bdaf_0 conda-forge krb5 1.21.3 h659f571_0 conda-forge lcms2 2.17 h717163a_0 conda-forge ld_impl_linux-64 2.43 h712a8e2_2 conda-forge lerc 4.0.0 h27087fc_0 conda-forge libabseil 20240722.0 cxx17_hbbce691_4 conda-forge libarrow 19.0.0 h00a82cf_8_cpu conda-forge libarrow-acero 19.0.0 hcb10f89_8_cpu conda-forge libarrow-dataset 19.0.0 hcb10f89_8_cpu conda-forge libarrow-substrait 19.0.0 h08228c5_8_cpu conda-forge libblas 3.9.0 28_h59b9bed_openblas conda-forge libbrotlicommon 1.1.0 hb9d3cd8_2 conda-forge libbrotlidec 1.1.0 hb9d3cd8_2 conda-forge libbrotlienc 1.1.0 hb9d3cd8_2 conda-forge libcblas 3.9.0 28_he106b2a_openblas conda-forge libcrc32c 1.1.2 h9c3ff4c_0 conda-forge libcurl 8.11.1 h332b0f4_0 conda-forge libdeflate 1.23 h4ddbbb0_0 conda-forge libedit 3.1.20250104 pl5321h7949ede_0 conda-forge libev 4.33 hd590300_2 conda-forge libevent 2.1.12 hf998b51_1 conda-forge libexpat 2.6.4 h5888daf_0 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc 14.2.0 h77fa898_1 conda-forge libgcc-ng 14.2.0 h69a702a_1 conda-forge libgfortran 14.2.0 h69a702a_1 conda-forge libgfortran5 14.2.0 hd5240d6_1 conda-forge libgomp 14.2.0 h77fa898_1 conda-forge libgoogle-cloud 2.34.0 h2b5623c_0 conda-forge libgoogle-cloud-storage 2.34.0 h0121fbd_0 conda-forge libgrpc 1.67.1 h25350d4_1 conda-forge libiconv 1.17 hd590300_2 conda-forge libjpeg-turbo 3.0.0 hd590300_1 conda-forge liblapack 3.9.0 28_h7ac8fdf_openblas conda-forge libllvm15 15.0.7 hb3ce162_4 conda-forge liblzma 5.6.4 hb9d3cd8_0 conda-forge liblzma-devel 5.6.4 hb9d3cd8_0 conda-forge libnghttp2 1.64.0 h161d5f1_0 conda-forge libnsl 2.0.1 hd590300_0 conda-forge libopenblas 0.3.28 pthreads_h94d23a6_1 conda-forge libopentelemetry-cpp 1.18.0 hfcad708_1 conda-forge libopentelemetry-cpp-headers 1.18.0 ha770c72_1 conda-forge libparquet 19.0.0 h081d1f1_8_cpu conda-forge libpng 1.6.46 h943b412_0 conda-forge libprotobuf 5.28.3 h6128344_1 conda-forge libre2-11 2024.07.02 hbbce691_2 conda-forge libsqlite 3.48.0 hee588c1_1 conda-forge libssh2 1.11.1 hf672d98_0 conda-forge libstdcxx 14.2.0 hc0a3c3a_1 conda-forge libstdcxx-ng 14.2.0 h4852527_1 conda-forge libthrift 0.21.0 h0e7cc3e_0 conda-forge libtiff 4.7.0 hd9ff511_3 conda-forge libutf8proc 2.10.0 h4c51ac1_0 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libwebp-base 1.5.0 h851e524_0 conda-forge libxcb 1.17.0 h8a09558_0 conda-forge libxml2 2.13.5 h0d44e9d_1 conda-forge libzlib 1.3.1 hb9d3cd8_2 conda-forge llvmlite 0.44.0 py312h374181b_0 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lz4 4.3.3 py312hf0f0c11_2 conda-forge lz4-c 1.10.0 h5888daf_1 conda-forge markupsafe 3.0.2 py312h178313f_1 conda-forge matplotlib-inline 0.1.7 pyhd8ed1ab_1 conda-forge msgpack-python 1.1.0 py312h68727a3_0 conda-forge ncurses 6.5 h2d0b736_3 conda-forge nlohmann_json 3.11.3 he02047a_1 conda-forge numba 0.61.0 py312h2e6246c_1 conda-forge numcodecs 0.15.0 py312hf9745cd_0 conda-forge numpy 2.1.3 py312h58c1407_0 conda-forge openjpeg 2.5.3 h5fbd93e_0 conda-forge openssl 3.4.0 h7b32b05_1 conda-forge orc 2.0.3 h12ee42a_2 conda-forge packaging 24.2 pyhd8ed1ab_2 conda-forge pandas 2.2.3 py312hf9745cd_1 conda-forge parso 0.8.4 pyhd8ed1ab_1 conda-forge partd 1.4.2 pyhd8ed1ab_0 conda-forge pexpect 4.9.0 pyhd8ed1ab_1 conda-forge pickleshare 0.7.5 pyhd8ed1ab_1004 conda-forge pillow 11.1.0 py312h80c1187_0 conda-forge pip 25.0.1 pyh8b19718_0 conda-forge proj 9.5.1 h0054346_0 conda-forge prometheus-cpp 1.3.0 ha5d0236_0 conda-forge prompt-toolkit 3.0.50 pyha770c72_0 conda-forge psutil 6.1.1 py312h66e93f0_0 conda-forge pthread-stubs 0.4 hb9d3cd8_1002 conda-forge ptyprocess 0.7.0 pyhd8ed1ab_1 conda-forge pure_eval 0.2.3 pyhd8ed1ab_1 conda-forge pyarrow 19.0.0 py312h7900ff3_0 conda-forge pyarrow-core 19.0.0 py312h01725c0_0_cpu conda-forge pycparser 2.22 pyh29332c3_1 conda-forge pygments 2.19.1 pyhd8ed1ab_0 conda-forge pyproj 3.7.0 py312he630544_0 conda-forge pysocks 1.7.1 pyha55dd90_7 conda-forge python 3.12.0 hab00c5b_0_cpython conda-forge python-dateutil 2.9.0.post0 pyhff2d567_1 conda-forge python-tzdata 2025.1 pyhd8ed1ab_0 conda-forge python_abi 3.12 5_cp312 conda-forge pytz 2024.1 pyhd8ed1ab_0 conda-forge pyyaml 6.0.2 py312h178313f_2 conda-forge re2 2024.07.02 h9925aae_2 conda-forge readline 8.2 h8228510_1 conda-forge s2n 1.5.11 h072c03f_0 conda-forge setuptools 75.8.0 pyhff2d567_0 conda-forge six 1.17.0 pyhd8ed1ab_0 conda-forge snappy 1.2.1 h8bd8927_1 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_1 conda-forge sqlite 3.48.0 h9eae976_1 conda-forge stack_data 0.6.3 pyhd8ed1ab_1 conda-forge tblib 3.0.0 pyhd8ed1ab_1 conda-forge tk 8.6.13 noxft_h4845f30_101 conda-forge toolz 1.0.0 pyhd8ed1ab_1 conda-forge tornado 6.4.2 py312h66e93f0_0 conda-forge traitlets 5.14.3 pyhd8ed1ab_1 conda-forge typing_extensions 4.12.2 pyha770c72_1 conda-forge tzdata 2025a h78e105d_0 conda-forge urllib3 2.3.0 pyhd8ed1ab_0 conda-forge wcwidth 0.2.13 pyhd8ed1ab_1 conda-forge wheel 0.45.1 pyhd8ed1ab_1 conda-forge wrapt 1.17.2 py312h66e93f0_0 conda-forge xarray 2025.1.2 pyhd8ed1ab_0 conda-forge xgrads 0.2.6 pyhd8ed1ab_1 conda-forge xorg-libxau 1.0.12 hb9d3cd8_0 conda-forge xorg-libxdmcp 1.1.5 hb9d3cd8_0 conda-forge xyzservices 2025.1.0 pyhd8ed1ab_0 conda-forge xz 5.6.4 hbcc6ac9_0 conda-forge xz-gpl-tools 5.6.4 hbcc6ac9_0 conda-forge xz-tools 5.6.4 hb9d3cd8_0 conda-forge yaml 0.2.5 h7f98852_2 conda-forge zarr 3.0.2 pyhd8ed1ab_0 conda-forge zict 3.0.0 pyhd8ed1ab_1 conda-forge zipp 3.21.0 pyhd8ed1ab_1 conda-forge zlib 1.3.1 hb9d3cd8_2 conda-forge zstandard 0.23.0 py312hef9b889_1 conda-forge zstd 1.5.6 ha6fb4c9_0 conda-forge
# Export the definition (versions, packages) to a YAML file
!micromamba env export -n modern > environment.yaml
!cat environment.yaml
name: modern channels: - conda-forge dependencies: - _libgcc_mutex=0.1=conda_forge - _openmp_mutex=4.5=2_gnu - asttokens=3.0.0=pyhd8ed1ab_1 - aws-c-auth=0.8.1=h205f482_0 - aws-c-cal=0.8.1=h1a47875_3 - aws-c-common=0.10.6=hb9d3cd8_0 - aws-c-compression=0.3.0=h4e1184b_5 - aws-c-event-stream=0.5.0=h7959bf6_11 - aws-c-http=0.9.2=hefd7a92_4 - aws-c-io=0.15.3=h173a860_6 - aws-c-mqtt=0.11.0=h11f4f37_12 - aws-c-s3=0.7.9=he1b24dc_1 - aws-c-sdkutils=0.2.2=h4e1184b_0 - aws-checksums=0.2.2=h4e1184b_4 - aws-crt-cpp=0.29.9=he0e7f3f_2 - aws-sdk-cpp=1.11.489=h4d475cb_0 - azure-core-cpp=1.14.0=h5cfcd09_0 - azure-identity-cpp=1.10.0=h113e628_0 - azure-storage-blobs-cpp=12.13.0=h3cf044e_1 - azure-storage-common-cpp=12.8.0=h736e048_1 - azure-storage-files-datalake-cpp=12.12.0=ha633028_1 - bokeh=3.6.3=pyhd8ed1ab_0 - brotli-python=1.1.0=py312h2ec8cdc_2 - bzip2=1.0.8=h4bc722e_7 - c-ares=1.34.4=hb9d3cd8_0 - ca-certificates=2025.1.31=hbcca054_0 - certifi=2024.12.14=pyhd8ed1ab_0 - cffi=1.17.1=py312h06ac9bb_0 - click=8.1.8=pyh707e725_0 - cloudpickle=3.1.1=pyhd8ed1ab_0 - contourpy=1.3.1=py312h68727a3_0 - crc32c=2.7.1=py312h66e93f0_0 - cytoolz=1.0.1=py312h66e93f0_0 - dask=2025.1.0=pyhd8ed1ab_0 - dask-core=2025.1.0=pyhd8ed1ab_0 - decorator=5.1.1=pyhd8ed1ab_1 - deprecated=1.2.18=pyhd8ed1ab_0 - distributed=2025.1.0=pyhd8ed1ab_0 - donfig=0.8.1.post1=pyhd8ed1ab_1 - exceptiongroup=1.2.2=pyhd8ed1ab_1 - executing=2.1.0=pyhd8ed1ab_1 - freetype=2.12.1=h267a509_2 - fsspec=2025.2.0=pyhd8ed1ab_0 - gflags=2.2.2=h5888daf_1005 - glog=0.7.1=hbabe93e_0 - h2=4.2.0=pyhd8ed1ab_0 - hpack=4.1.0=pyhd8ed1ab_0 - hyperframe=6.1.0=pyhd8ed1ab_0 - importlib-metadata=8.6.1=pyha770c72_0 - ipython=8.32.0=pyh907856f_0 - jedi=0.19.2=pyhd8ed1ab_1 - jinja2=3.1.5=pyhd8ed1ab_0 - keyutils=1.6.1=h166bdaf_0 - krb5=1.21.3=h659f571_0 - lcms2=2.17=h717163a_0 - ld_impl_linux-64=2.43=h712a8e2_2 - lerc=4.0.0=h27087fc_0 - libabseil=20240722.0=cxx17_hbbce691_4 - libarrow=19.0.0=h00a82cf_8_cpu - libarrow-acero=19.0.0=hcb10f89_8_cpu - libarrow-dataset=19.0.0=hcb10f89_8_cpu - libarrow-substrait=19.0.0=h08228c5_8_cpu - libblas=3.9.0=28_h59b9bed_openblas - libbrotlicommon=1.1.0=hb9d3cd8_2 - libbrotlidec=1.1.0=hb9d3cd8_2 - libbrotlienc=1.1.0=hb9d3cd8_2 - libcblas=3.9.0=28_he106b2a_openblas - libcrc32c=1.1.2=h9c3ff4c_0 - libcurl=8.11.1=h332b0f4_0 - libdeflate=1.23=h4ddbbb0_0 - libedit=3.1.20250104=pl5321h7949ede_0 - libev=4.33=hd590300_2 - libevent=2.1.12=hf998b51_1 - libexpat=2.6.4=h5888daf_0 - libffi=3.4.2=h7f98852_5 - libgcc=14.2.0=h77fa898_1 - libgcc-ng=14.2.0=h69a702a_1 - libgfortran=14.2.0=h69a702a_1 - libgfortran5=14.2.0=hd5240d6_1 - libgomp=14.2.0=h77fa898_1 - libgoogle-cloud=2.34.0=h2b5623c_0 - libgoogle-cloud-storage=2.34.0=h0121fbd_0 - libgrpc=1.67.1=h25350d4_1 - libiconv=1.17=hd590300_2 - libjpeg-turbo=3.0.0=hd590300_1 - liblapack=3.9.0=28_h7ac8fdf_openblas - libllvm15=15.0.7=hb3ce162_4 - liblzma=5.6.4=hb9d3cd8_0 - liblzma-devel=5.6.4=hb9d3cd8_0 - libnghttp2=1.64.0=h161d5f1_0 - libnsl=2.0.1=hd590300_0 - libopenblas=0.3.28=pthreads_h94d23a6_1 - libopentelemetry-cpp=1.18.0=hfcad708_1 - libopentelemetry-cpp-headers=1.18.0=ha770c72_1 - libparquet=19.0.0=h081d1f1_8_cpu - libpng=1.6.46=h943b412_0 - libprotobuf=5.28.3=h6128344_1 - libre2-11=2024.07.02=hbbce691_2 - libsqlite=3.48.0=hee588c1_1 - libssh2=1.11.1=hf672d98_0 - libstdcxx=14.2.0=hc0a3c3a_1 - libstdcxx-ng=14.2.0=h4852527_1 - libthrift=0.21.0=h0e7cc3e_0 - libtiff=4.7.0=hd9ff511_3 - libutf8proc=2.10.0=h4c51ac1_0 - libuuid=2.38.1=h0b41bf4_0 - libwebp-base=1.5.0=h851e524_0 - libxcb=1.17.0=h8a09558_0 - libxml2=2.13.5=h0d44e9d_1 - libzlib=1.3.1=hb9d3cd8_2 - llvmlite=0.44.0=py312h374181b_0 - locket=1.0.0=pyhd8ed1ab_0 - lz4=4.3.3=py312hf0f0c11_2 - lz4-c=1.10.0=h5888daf_1 - markupsafe=3.0.2=py312h178313f_1 - matplotlib-inline=0.1.7=pyhd8ed1ab_1 - msgpack-python=1.1.0=py312h68727a3_0 - ncurses=6.5=h2d0b736_3 - nlohmann_json=3.11.3=he02047a_1 - numba=0.61.0=py312h2e6246c_1 - numcodecs=0.15.0=py312hf9745cd_0 - numpy=2.1.3=py312h58c1407_0 - openjpeg=2.5.3=h5fbd93e_0 - openssl=3.4.0=h7b32b05_1 - orc=2.0.3=h12ee42a_2 - packaging=24.2=pyhd8ed1ab_2 - pandas=2.2.3=py312hf9745cd_1 - parso=0.8.4=pyhd8ed1ab_1 - partd=1.4.2=pyhd8ed1ab_0 - pexpect=4.9.0=pyhd8ed1ab_1 - pickleshare=0.7.5=pyhd8ed1ab_1004 - pillow=11.1.0=py312h80c1187_0 - pip=25.0.1=pyh8b19718_0 - proj=9.5.1=h0054346_0 - prometheus-cpp=1.3.0=ha5d0236_0 - prompt-toolkit=3.0.50=pyha770c72_0 - psutil=6.1.1=py312h66e93f0_0 - pthread-stubs=0.4=hb9d3cd8_1002 - ptyprocess=0.7.0=pyhd8ed1ab_1 - pure_eval=0.2.3=pyhd8ed1ab_1 - pyarrow=19.0.0=py312h7900ff3_0 - pyarrow-core=19.0.0=py312h01725c0_0_cpu - pycparser=2.22=pyh29332c3_1 - pygments=2.19.1=pyhd8ed1ab_0 - pyproj=3.7.0=py312he630544_0 - pysocks=1.7.1=pyha55dd90_7 - python=3.12.0=hab00c5b_0_cpython - python-dateutil=2.9.0.post0=pyhff2d567_1 - python-tzdata=2025.1=pyhd8ed1ab_0 - python_abi=3.12=5_cp312 - pytz=2024.1=pyhd8ed1ab_0 - pyyaml=6.0.2=py312h178313f_2 - re2=2024.07.02=h9925aae_2 - readline=8.2=h8228510_1 - s2n=1.5.11=h072c03f_0 - setuptools=75.8.0=pyhff2d567_0 - six=1.17.0=pyhd8ed1ab_0 - snappy=1.2.1=h8bd8927_1 - sortedcontainers=2.4.0=pyhd8ed1ab_1 - sqlite=3.48.0=h9eae976_1 - stack_data=0.6.3=pyhd8ed1ab_1 - tblib=3.0.0=pyhd8ed1ab_1 - tk=8.6.13=noxft_h4845f30_101 - toolz=1.0.0=pyhd8ed1ab_1 - tornado=6.4.2=py312h66e93f0_0 - traitlets=5.14.3=pyhd8ed1ab_1 - typing_extensions=4.12.2=pyha770c72_1 - tzdata=2025a=h78e105d_0 - urllib3=2.3.0=pyhd8ed1ab_0 - wcwidth=0.2.13=pyhd8ed1ab_1 - wheel=0.45.1=pyhd8ed1ab_1 - wrapt=1.17.2=py312h66e93f0_0 - xarray=2025.1.2=pyhd8ed1ab_0 - xgrads=0.2.6=pyhd8ed1ab_1 - xorg-libxau=1.0.12=hb9d3cd8_0 - xorg-libxdmcp=1.1.5=hb9d3cd8_0 - xyzservices=2025.1.0=pyhd8ed1ab_0 - xz=5.6.4=hbcc6ac9_0 - xz-gpl-tools=5.6.4=hbcc6ac9_0 - xz-tools=5.6.4=hb9d3cd8_0 - yaml=0.2.5=h7f98852_2 - zarr=3.0.2=pyhd8ed1ab_0 - zict=3.0.0=pyhd8ed1ab_1 - zipp=3.21.0=pyhd8ed1ab_1 - zlib=1.3.1=hb9d3cd8_2 - zstandard=0.23.0=py312hef9b889_1 - zstd=1.5.6=ha6fb4c9_0 prefix: "/jetfs/home/yourusername/micromamba/envs/modern"
Note: Versions and packages are listed. As well as the path where it was installed
With that file you will be able to rebuild this environment at anytime.
Backup with pip¶
If you want to use pip
later to restore your environment, you can use
./envs/test/bin/pip list format=freeze > requirements.txt
However, this is quite different from conda/micromamba. You need to have the correct version of python available otherwise you can not restore the environment.
Restore¶
Maybe you get a environment file from a colleague or it's your backup, there are ways to restore your environment.
# Create the environment in a special path
# -y yes to questions
# -q quiet
!micromamba env create -y -q -n modern2 -f environment.yaml
# this can take some time to finish.
!micromamba env list
Name Active Path ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base * /jetfs/home/yourusername/micromamba modern /jetfs/home/yourusername/micromamba/envs/modern modern2 /jetfs/home/yourusername/micromamba/envs/modern2 /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda2-2019.10-5pou6jiel7heivyyjwlgwcyltniipjlp /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2019.10-tmy5mgp3gzy7uqkouhm33gfyp3p3xpsu /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2020.07-weugqkfkxd6zmn2irm7lpmujzczwebiw /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda2-4.7.12.1-zduqggvbh63zrdghrlty4ncwiclobaja /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda3-4.8.2-3m7b6t2kgedyr3jnd2nasmgiq7wm27iv
!micromamba list -n modern2
List of packages in environment: "/jetfs/home/yourusername/micromamba/envs/modern2" Name Version Build Channel ───────────────────────────────────────────────────────────────────────────────────── _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge asttokens 3.0.0 pyhd8ed1ab_1 conda-forge aws-c-auth 0.8.1 h205f482_0 conda-forge aws-c-cal 0.8.1 h1a47875_3 conda-forge aws-c-common 0.10.6 hb9d3cd8_0 conda-forge aws-c-compression 0.3.0 h4e1184b_5 conda-forge aws-c-event-stream 0.5.0 h7959bf6_11 conda-forge aws-c-http 0.9.2 hefd7a92_4 conda-forge aws-c-io 0.15.3 h173a860_6 conda-forge aws-c-mqtt 0.11.0 h11f4f37_12 conda-forge aws-c-s3 0.7.9 he1b24dc_1 conda-forge aws-c-sdkutils 0.2.2 h4e1184b_0 conda-forge aws-checksums 0.2.2 h4e1184b_4 conda-forge aws-crt-cpp 0.29.9 he0e7f3f_2 conda-forge aws-sdk-cpp 1.11.489 h4d475cb_0 conda-forge azure-core-cpp 1.14.0 h5cfcd09_0 conda-forge azure-identity-cpp 1.10.0 h113e628_0 conda-forge azure-storage-blobs-cpp 12.13.0 h3cf044e_1 conda-forge azure-storage-common-cpp 12.8.0 h736e048_1 conda-forge azure-storage-files-datalake-cpp 12.12.0 ha633028_1 conda-forge bokeh 3.6.3 pyhd8ed1ab_0 conda-forge brotli-python 1.1.0 py312h2ec8cdc_2 conda-forge bzip2 1.0.8 h4bc722e_7 conda-forge c-ares 1.34.4 hb9d3cd8_0 conda-forge ca-certificates 2025.1.31 hbcca054_0 conda-forge certifi 2024.12.14 pyhd8ed1ab_0 conda-forge cffi 1.17.1 py312h06ac9bb_0 conda-forge click 8.1.8 pyh707e725_0 conda-forge cloudpickle 3.1.1 pyhd8ed1ab_0 conda-forge contourpy 1.3.1 py312h68727a3_0 conda-forge crc32c 2.7.1 py312h66e93f0_0 conda-forge cytoolz 1.0.1 py312h66e93f0_0 conda-forge dask 2025.1.0 pyhd8ed1ab_0 conda-forge dask-core 2025.1.0 pyhd8ed1ab_0 conda-forge decorator 5.1.1 pyhd8ed1ab_1 conda-forge deprecated 1.2.18 pyhd8ed1ab_0 conda-forge distributed 2025.1.0 pyhd8ed1ab_0 conda-forge donfig 0.8.1.post1 pyhd8ed1ab_1 conda-forge exceptiongroup 1.2.2 pyhd8ed1ab_1 conda-forge executing 2.1.0 pyhd8ed1ab_1 conda-forge freetype 2.12.1 h267a509_2 conda-forge fsspec 2025.2.0 pyhd8ed1ab_0 conda-forge gflags 2.2.2 h5888daf_1005 conda-forge glog 0.7.1 hbabe93e_0 conda-forge h2 4.2.0 pyhd8ed1ab_0 conda-forge hpack 4.1.0 pyhd8ed1ab_0 conda-forge hyperframe 6.1.0 pyhd8ed1ab_0 conda-forge importlib-metadata 8.6.1 pyha770c72_0 conda-forge ipython 8.32.0 pyh907856f_0 conda-forge jedi 0.19.2 pyhd8ed1ab_1 conda-forge jinja2 3.1.5 pyhd8ed1ab_0 conda-forge keyutils 1.6.1 h166bdaf_0 conda-forge krb5 1.21.3 h659f571_0 conda-forge lcms2 2.17 h717163a_0 conda-forge ld_impl_linux-64 2.43 h712a8e2_2 conda-forge lerc 4.0.0 h27087fc_0 conda-forge libabseil 20240722.0 cxx17_hbbce691_4 conda-forge libarrow 19.0.0 h00a82cf_8_cpu conda-forge libarrow-acero 19.0.0 hcb10f89_8_cpu conda-forge libarrow-dataset 19.0.0 hcb10f89_8_cpu conda-forge libarrow-substrait 19.0.0 h08228c5_8_cpu conda-forge libblas 3.9.0 28_h59b9bed_openblas conda-forge libbrotlicommon 1.1.0 hb9d3cd8_2 conda-forge libbrotlidec 1.1.0 hb9d3cd8_2 conda-forge libbrotlienc 1.1.0 hb9d3cd8_2 conda-forge libcblas 3.9.0 28_he106b2a_openblas conda-forge libcrc32c 1.1.2 h9c3ff4c_0 conda-forge libcurl 8.11.1 h332b0f4_0 conda-forge libdeflate 1.23 h4ddbbb0_0 conda-forge libedit 3.1.20250104 pl5321h7949ede_0 conda-forge libev 4.33 hd590300_2 conda-forge libevent 2.1.12 hf998b51_1 conda-forge libexpat 2.6.4 h5888daf_0 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc 14.2.0 h77fa898_1 conda-forge libgcc-ng 14.2.0 h69a702a_1 conda-forge libgfortran 14.2.0 h69a702a_1 conda-forge libgfortran5 14.2.0 hd5240d6_1 conda-forge libgomp 14.2.0 h77fa898_1 conda-forge libgoogle-cloud 2.34.0 h2b5623c_0 conda-forge libgoogle-cloud-storage 2.34.0 h0121fbd_0 conda-forge libgrpc 1.67.1 h25350d4_1 conda-forge libiconv 1.17 hd590300_2 conda-forge libjpeg-turbo 3.0.0 hd590300_1 conda-forge liblapack 3.9.0 28_h7ac8fdf_openblas conda-forge libllvm15 15.0.7 hb3ce162_4 conda-forge liblzma 5.6.4 hb9d3cd8_0 conda-forge liblzma-devel 5.6.4 hb9d3cd8_0 conda-forge libnghttp2 1.64.0 h161d5f1_0 conda-forge libnsl 2.0.1 hd590300_0 conda-forge libopenblas 0.3.28 pthreads_h94d23a6_1 conda-forge libopentelemetry-cpp 1.18.0 hfcad708_1 conda-forge libopentelemetry-cpp-headers 1.18.0 ha770c72_1 conda-forge libparquet 19.0.0 h081d1f1_8_cpu conda-forge libpng 1.6.46 h943b412_0 conda-forge libprotobuf 5.28.3 h6128344_1 conda-forge libre2-11 2024.07.02 hbbce691_2 conda-forge libsqlite 3.48.0 hee588c1_1 conda-forge libssh2 1.11.1 hf672d98_0 conda-forge libstdcxx 14.2.0 hc0a3c3a_1 conda-forge libstdcxx-ng 14.2.0 h4852527_1 conda-forge libthrift 0.21.0 h0e7cc3e_0 conda-forge libtiff 4.7.0 hd9ff511_3 conda-forge libutf8proc 2.10.0 h4c51ac1_0 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libwebp-base 1.5.0 h851e524_0 conda-forge libxcb 1.17.0 h8a09558_0 conda-forge libxml2 2.13.5 h0d44e9d_1 conda-forge libzlib 1.3.1 hb9d3cd8_2 conda-forge llvmlite 0.44.0 py312h374181b_0 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lz4 4.3.3 py312hf0f0c11_2 conda-forge lz4-c 1.10.0 h5888daf_1 conda-forge markupsafe 3.0.2 py312h178313f_1 conda-forge matplotlib-inline 0.1.7 pyhd8ed1ab_1 conda-forge msgpack-python 1.1.0 py312h68727a3_0 conda-forge ncurses 6.5 h2d0b736_3 conda-forge nlohmann_json 3.11.3 he02047a_1 conda-forge numba 0.61.0 py312h2e6246c_1 conda-forge numcodecs 0.15.0 py312hf9745cd_0 conda-forge numpy 2.1.3 py312h58c1407_0 conda-forge openjpeg 2.5.3 h5fbd93e_0 conda-forge openssl 3.4.0 h7b32b05_1 conda-forge orc 2.0.3 h12ee42a_2 conda-forge packaging 24.2 pyhd8ed1ab_2 conda-forge pandas 2.2.3 py312hf9745cd_1 conda-forge parso 0.8.4 pyhd8ed1ab_1 conda-forge partd 1.4.2 pyhd8ed1ab_0 conda-forge pexpect 4.9.0 pyhd8ed1ab_1 conda-forge pickleshare 0.7.5 pyhd8ed1ab_1004 conda-forge pillow 11.1.0 py312h80c1187_0 conda-forge pip 25.0.1 pyh8b19718_0 conda-forge proj 9.5.1 h0054346_0 conda-forge prometheus-cpp 1.3.0 ha5d0236_0 conda-forge prompt-toolkit 3.0.50 pyha770c72_0 conda-forge psutil 6.1.1 py312h66e93f0_0 conda-forge pthread-stubs 0.4 hb9d3cd8_1002 conda-forge ptyprocess 0.7.0 pyhd8ed1ab_1 conda-forge pure_eval 0.2.3 pyhd8ed1ab_1 conda-forge pyarrow 19.0.0 py312h7900ff3_0 conda-forge pyarrow-core 19.0.0 py312h01725c0_0_cpu conda-forge pycparser 2.22 pyh29332c3_1 conda-forge pygments 2.19.1 pyhd8ed1ab_0 conda-forge pyproj 3.7.0 py312he630544_0 conda-forge pysocks 1.7.1 pyha55dd90_7 conda-forge python 3.12.0 hab00c5b_0_cpython conda-forge python-dateutil 2.9.0.post0 pyhff2d567_1 conda-forge python-tzdata 2025.1 pyhd8ed1ab_0 conda-forge python_abi 3.12 5_cp312 conda-forge pytz 2024.1 pyhd8ed1ab_0 conda-forge pyyaml 6.0.2 py312h178313f_2 conda-forge re2 2024.07.02 h9925aae_2 conda-forge readline 8.2 h8228510_1 conda-forge s2n 1.5.11 h072c03f_0 conda-forge setuptools 75.8.0 pyhff2d567_0 conda-forge six 1.17.0 pyhd8ed1ab_0 conda-forge snappy 1.2.1 h8bd8927_1 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_1 conda-forge sqlite 3.48.0 h9eae976_1 conda-forge stack_data 0.6.3 pyhd8ed1ab_1 conda-forge tblib 3.0.0 pyhd8ed1ab_1 conda-forge tk 8.6.13 noxft_h4845f30_101 conda-forge toolz 1.0.0 pyhd8ed1ab_1 conda-forge tornado 6.4.2 py312h66e93f0_0 conda-forge traitlets 5.14.3 pyhd8ed1ab_1 conda-forge typing_extensions 4.12.2 pyha770c72_1 conda-forge tzdata 2025a h78e105d_0 conda-forge urllib3 2.3.0 pyhd8ed1ab_0 conda-forge wcwidth 0.2.13 pyhd8ed1ab_1 conda-forge wheel 0.45.1 pyhd8ed1ab_1 conda-forge wrapt 1.17.2 py312h66e93f0_0 conda-forge xarray 2025.1.2 pyhd8ed1ab_0 conda-forge xgrads 0.2.6 pyhd8ed1ab_1 conda-forge xorg-libxau 1.0.12 hb9d3cd8_0 conda-forge xorg-libxdmcp 1.1.5 hb9d3cd8_0 conda-forge xyzservices 2025.1.0 pyhd8ed1ab_0 conda-forge xz 5.6.4 hbcc6ac9_0 conda-forge xz-gpl-tools 5.6.4 hbcc6ac9_0 conda-forge xz-tools 5.6.4 hb9d3cd8_0 conda-forge yaml 0.2.5 h7f98852_2 conda-forge zarr 3.0.2 pyhd8ed1ab_0 conda-forge zict 3.0.0 pyhd8ed1ab_1 conda-forge zipp 3.21.0 pyhd8ed1ab_1 conda-forge zlib 1.3.1 hb9d3cd8_2 conda-forge zstandard 0.23.0 py312hef9b889_1 conda-forge zstd 1.5.6 ha6fb4c9_0 conda-forge
Restore with pip¶
When you want to use pip to restore the environment:
# create a virtual environment
python3 -m venv env
# use that to install the packages
./env/bin/pip install -r requirements.txt
Here it will use the python3 that you give, meaning that it will not be Python 3.9 as we specified above. Download the correct python interpreter first. here or any other way.
Design¶
It is possible to write your own environment file and use it for build a special environment.
There are three things you need:
- name
- channels (mostly conda-forge)
- dependencies (packages)
An example yaml file
name: selfdesigned
channels:
- conda-forge
dependencies:
- numpy
- pandas
- xarray
- pip:
- metpy
you can specify versions using numpy=1.0
or python=3.6
. If no version is given the newest compatible version will be used.
%%writefile design.yaml
name: selfdesigned
channels:
- conda-forge
dependencies:
- numpy
- pandas
- xarray
- pip:
- metpy
Overwriting design.yaml
!micromamba env create -q -y -f design.yaml -n selfdesigned
warning libmamba You are using 'pip' as an additional package manager.
Be aware that packages installed with 'pip' are managed independently from 'conda-forge' channel.
!micromamba env list
Name Active Path ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base * /jetfs/home/yourusername/micromamba modern /jetfs/home/yourusername/micromamba/envs/modern modern2 /jetfs/home/yourusername/micromamba/envs/modern2 selfdesigned /jetfs/home/yourusername/micromamba/envs/selfdesigned /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda2-2019.10-5pou6jiel7heivyyjwlgwcyltniipjlp /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2019.10-tmy5mgp3gzy7uqkouhm33gfyp3p3xpsu /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/anaconda3-2020.07-weugqkfkxd6zmn2irm7lpmujzczwebiw /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda2-4.7.12.1-zduqggvbh63zrdghrlty4ncwiclobaja /jetfs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.3.1/miniconda3-4.8.2-3m7b6t2kgedyr3jnd2nasmgiq7wm27iv