calcoloscientifico:cluster:softwareapplicativo:conda_user
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
calcoloscientifico:cluster:softwareapplicativo:conda_user [18/03/2021 11:21] – fabio.spataro | calcoloscientifico:cluster:softwareapplicativo:conda_user [16/01/2025 17:02] (versione attuale) – fabio.spataro | ||
---|---|---|---|
Linea 3: | Linea 3: | ||
Users or groups can build their own environments. | Users or groups can build their own environments. | ||
- | ==== Template for users or groups | + | ==== General template |
+ | |||
+ | General template that can be used to create personal or group environments: | ||
<code bash hpc-make-condaenv-template.sh> | <code bash hpc-make-condaenv-template.sh> | ||
Linea 10: | Linea 12: | ||
set -e | set -e | ||
- | module load miniconda3-test | + | module load miniconda3 |
source " | source " | ||
Linea 16: | Linea 18: | ||
CONDAENV_NAME=' | CONDAENV_NAME=' | ||
CONDAENV_VERSION=$(date ' | CONDAENV_VERSION=$(date ' | ||
- | PYTHON_VERSION=' | + | PYTHON_VERSION=' |
CONDAENV=" | CONDAENV=" | ||
Linea 36: | Linea 38: | ||
CONDAENV_PREFIX=" | CONDAENV_PREFIX=" | ||
CONDAENV_SYMLNK=" | CONDAENV_SYMLNK=" | ||
+ | fi | ||
+ | |||
+ | if [ $UID = 0 ]; then | ||
+ | conda --version | ||
+ | conda update conda | ||
+ | conda --version | ||
+ | echo | ||
fi | fi | ||
Linea 41: | Linea 50: | ||
echo " | echo " | ||
echo | echo | ||
- | echo -n " | + | |
+ | if [ -d " | ||
+ | echo -n " | ||
+ | |||
+ | read ans | ||
+ | |||
+ | case " | ||
+ | [yY]|[yY][Ee][Ss]) | ||
+ | conda env remove --name " | ||
+ | ;; | ||
+ | [nN]|[nN][oO]) | ||
+ | ;; | ||
+ | *) | ||
+ | echo | ||
+ | exec " | ||
+ | exit | ||
+ | ;; | ||
+ | esac | ||
+ | fi | ||
+ | |||
+ | if [ -d " | ||
+ | echo -n " | ||
+ | else | ||
+ | | ||
+ | fi | ||
read ans | read ans | ||
Linea 60: | Linea 93: | ||
conda info | conda info | ||
- | if [ $UID = 0 ]; then | + | if [ ! -d "$CONDAENV_PREFIX" |
- | conda --version | + | conda create |
- | conda update conda | + | |
- | conda --version | + | |
fi | fi | ||
- | |||
- | if [ -d " | ||
- | conda env remove --name " | ||
- | fi | ||
- | |||
- | conda create --yes --name " | ||
conda activate " | conda activate " | ||
conda install --yes --name " | conda install --yes --name " | ||
- | --channel conda-forge \ | + | |
- | 7zip | + | xz |
conda list || true | conda list || true | ||
Linea 91: | Linea 116: | ||
/ | / | ||
</ | </ | ||
+ | |||
+ | Customize your script by editing CONDAENV_NAME, | ||
+ | |||
+ | The "conda install" | ||
+ | |||
+ | It is also possible to install python packages using the " | ||
+ | |||
==== Creating a user environment ==== | ==== Creating a user environment ==== | ||
Linea 106: | Linea 138: | ||
Create a script from the template and run it. | Create a script from the template and run it. | ||
- | === Work session | + | ==== Working |
+ | |||
+ | With conda, you can create, export, list, remove, and update that have different versions of Python and/or packages installed in them. Switching or moving between environments is called activating the environment. | ||
+ | |||
+ | === Interactive work session === | ||
+ | |||
+ | If you want to work at group level change group otherwise skip this step: | ||
+ | |||
+ | < | ||
+ | newgrp < | ||
+ | </ | ||
+ | |||
+ | Typical work session with conda: | ||
< | < | ||
[< | [< | ||
+ | |||
[< | [< | ||
+ | |||
[< | [< | ||
+ | |||
[< | [< | ||
conda 4.9.2 | conda 4.9.2 | ||
Linea 120: | Linea 167: | ||
(base) [< | (base) [< | ||
- | |||
/ | / | ||
Linea 127: | Linea 173: | ||
(base) [< | (base) [< | ||
+ | |||
+ | [< | ||
</ | </ | ||
Linea 137: | Linea 185: | ||
=== Alternate channels === | === Alternate channels === | ||
- | To search for alternate channels that may provide the conda package you're looking for, navigate to [[https:// | + | To search for alternate channels that may provide the conda package you're looking for, navigate to [[https://anaconda.org|anaconda.org]] and use the search bar at the top of the page. |
To add a new channel: | To add a new channel: | ||
Linea 145: | Linea 193: | ||
</ | </ | ||
- | === Environment | + | === Remove unused packages and caches |
- | With conda, you can create, export, list, remove, and update [[https:// | + | To remove |
+ | |||
+ | < | ||
+ | conda clean --all | ||
+ | </code> | ||
=== Environments list === | === Environments list === |
calcoloscientifico/cluster/softwareapplicativo/conda_user.1616062907.txt.gz · Ultima modifica: 18/03/2021 11:21 da fabio.spataro