software:miniconda:darwin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:miniconda:darwin [2025-10-15 15:39] thuachensoftware:miniconda:darwin [2025-11-06 15:39] (current) – [Migrating Environments] thuachen
Line 20: Line 20:
  
 ===== Installing Applications with Conda ===== ===== Installing Applications with Conda =====
-You can create a new Conda environment either by name or by path. +<note tip
-<code+Note: In the examples below, please modify paths, usernames, and environment names (e.g., ''/lustre/workgroup/sw/''..., ''myenv'') to match your own account and project setup.  
-conda create --name myenv python=3.13 +</note
-</code+You can create a new Conda environment with a specific package and in a specific pathFor exampleto create an environment in a specific path, such as your ''/lustre/workgroup'' directory, 
-By default, Conda environments are created in your home directoryHoweverthe limited home directory quotas (20 GB) can be filled up quickly. You can create an environment in a specific path, such as your /work/workgroup directory, +<code bash
-<code> +[(my_workgroup:user)@login01 ~]$ conda create -p /lustre/workgroup/sw/myenv <my_package>
-conda create -p $WORKDIR/$USER/myenv python=3.13+
 </code> </code>
 +
 +<note important>
 +By default, Conda environments created by ''%%--%%name'' or ''-n'' are in your home directory. However, the limited home directory quotas (20 GB) can be filled up quickly. It is recommended to create environments by specifying path ''-p'' in your work directory instead of ''$HOME'' to avoid quota issues.
 +</note>
 After creating the Conda environments, you can activate the local conda environment using, After creating the Conda environments, you can activate the local conda environment using,
-<code> +<code bash
-conda activate myenv+[(my_workgroup:user)@login01 ~]$ conda activate /lustre/workgroup/sw/myenv 
 +</code> 
 +You can install the desired packages in the current environment, for example, 
 +<code bash> 
 +(/lustre/workgroup/sw/myenv)[(my_workgroup:user)@login01 ~]$ conda install <my_package> 
 +</code> 
 +To list packages in the currently active environment, use 
 +<code bash> 
 +(/lustre/workgroup/sw/myenv)[(my_workgroup:user)@login01 ~]$ conda list 
 +# packages in environment at /lustre/workgroup/sw/myenv: 
 +
 +# Name                    Version                   Build  Channel 
 +_libgcc_mutex             0.1                 conda_forge    conda-forge 
 +_openmp_mutex             4.5                       2_gnu    conda-forge 
 +absl-py                   2.3.1                    pypi_0    pypi 
 +astunparse                1.6.3                    pypi_0    pypi 
 +bzip2                     1.0.8                hda65f42_8    conda-forge 
 +ca-certificates           2025.10.5            hbd8a1cb_0    conda-forge 
 +certifi                   2025.10.5                pypi_0    pypi 
 +</code> 
 +To deactivate the environment, do: 
 +<code bash> 
 +(/lustre/workgroup/sw/myenv)[(my_workgroup:user)@login01 ~]$ conda deactivate 
 +[(my_workgroup:user)@login01 ~]$ 
 +</code> 
 +To remove an environment, run: 
 +<code bash> 
 +[(my_workgroup:user)@login01 ~]$ conda remove -p /lustre/workgroup/sw/myenv --all 
 +</code> 
 +To remove the unused packages and caches, do 
 +<code bash> 
 +[(my_workgroup:user)@login01 ~]$ conda clean --all 
 +</code> 
 + 
 +===== Migrating Environments ===== 
 + 
 +In the terminal window, to view the environments available to you, use 
 +<code bash> 
 +[(my_workgroup:user)@login01 ~]$ conda env list 
 +# conda environments: 
 +
 +base                   /opt/shared/miniconda/25.1.1.2 
 +                      */lustre/workgroup/sw/myenv 
 +</code> 
 + 
 +After activating the desired environment, export the current environment, 
 +<code bash> 
 +[(my_workgroup:user)@login01 ~]$ conda activate /lustre/workgroup/sw/myenv 
 +(/lustre/workgroup/sw/myenv)[(my_workgroup:user)@login01 ~]$ conda export --file=myenv.yaml 
 +name: /lustre/workgroup/sw/myenv 
 +channels: 
 +  - conda-forge 
 +dependencies: 
 +  - _libgcc_mutex=0.1=conda_forge 
 +  - _openmp_mutex=4.5=2_gnu 
 +  - bzip2=1.0.8=hda65f42_8 
 +  - ca-certificates=2025.10.5=hbd8a1cb_0 
 +  - cuda-version=11.8=h70ddcb2_3 
 +  - cudatoolkit=11.8.0=h4ba93d1_13 
 +  - cudnn=8.9.7.29=hbc23b4c_3  
 +... 
 +... 
 + 
 +prefix: /lustre/workgroup/sw/myenv  
 </code> </code>
-Then you can install the desired packages, for example, +Then you can duplicate the same environment with 
-<code> +<code bash
-conda install <package_name>+(/lustre/workgroup/sw/myenv)[(my_workgroup:user)@login01 ~]$ conda deactivate 
 +[(my_workgroup:user)@login01 ~]$ conda create -p /lustre/workgroup/sw/myenv_2 -f myenv.yml
 </code> </code>
 +
 +===== Recipes ====
 +
 +Examples documented as recipes to be used for specific installations, including using a ''workgroup'' directory as well as creating VALET packages for these environments and job scripts setup for batch runs, but can also perhaps help others in solving similar installation dilemmas.
 +
 +  * [[technical:recipes:tensorflow-in-virtualenv|Building a TensorFlow Python Virtual Environment]]
  • software/miniconda/darwin.1760557187.txt.gz
  • Last modified: 2025-10-15 15:39
  • by thuachen