SlideShare a Scribd company logo
1 of 23
Conda environment system &
how to use it on CSUC machines
Víctor Pérez
17 / 03 / 2021
Index
1. Notice: model transition
2. What is conda?
3. Scope of the project
4. How to use conda
5. Conda environments
6. Package management
7. Python through conda
8. R through conda
Notice: model transition
• Very important: we are in the process of
abandoning shared environments in favour of
private environments only
• Old shared environments will be available for
your old scripts, but won't be modified further
• We will clone them as private environments for
users and groups who need them
Notice: model transition
• We will progressively contact users of shared
environments to assist you in the "privatisation" of the
environments you need
• If you already use private environments, simply change
the module you load and that's all, no transition
needed :)
• New live and minimal conda installation:
module load conda/current
What is conda?
• Originally: Anaconda, a distribution of Python
including common scientific packages
https://www.anaconda.com/
• Extended to include R and R packages, scientific
libraries, other software, etc.
• conda: core package manager for the Anaconda
project
What is conda?
• conda installs and updates binary versions of
Python and R packages from its own (or third
party) repositories
• It is an alternative to other repository systems,
like pip for Python or CRAN for R
• It is also a way to manage dependencies for
Python and R packages
But conda isn't...
• A repository of system software packages
(such as apt or yum)
• A repository of source code
• A replacement for environment modules
• Exhaustive or infallible
Scope of the project
• Python
• R
• Jupyter, Spyder, Rstudio...
• NumPy, SciPy, Pandas, Numba, Dask...
• Scikit-learn, TensorFlow, Theano...
• Matplotlib, Bokeh, Datashader, Holoviews...
• A variety of external libraries and tools
Conda channels
• Channels are thematic collections of packages,
useful to avoid version conflicts (equivalent to
repositories)
• Examples:
– pkgs/main: default channel
– conda-forge: large collection of third party packages
– bioconda: software for bioinformatics
– r: tailored to R users
How to use conda
• We need to load an environment module to
configure conda.
module load conda/current
Obsolete versions for backwards compatibility:
module load conda/2 & module load conda/3
How to use conda
• Then we use the command conda (+ action) to
run it:
conda list
conda activate
conda create
conda search
conda install
conda update
conda help
Conda environments
• Inside a given installation of conda, there are a
number of environments
• Environments are profiles: each will have a
different list of packages and versions installed
• We are transitioning to working exclusively
with private environments owned by users
Activating/Deactivating environments
• To see a list of environments: conda env list
• To load an env: conda activate <env_name>
• To unload: conda deactivate
Activating/Deactivating environments
• To see the contents of an env: conda list [-n env_name]
(by default, currently activated environment)
• Note: source activate and source deactivate are obsolete
Environments
• Users can create their own private envs (stored at
$HOME/.conda/envs) visible only to them
• To create a new empty environment: conda
create -n <env_name>
• To create a new environment with packages
preinstalled in it: conda create –n <env_name>
[list of packages]
Environments
• To install one or more packages in a private
env: conda install [-n env_name] <packages>
• If no env is specified, they are installed in the
currently active environment
• Version and channel can also be
specified: conda install [-n env_name] [-C
channel] <package=version>
Environments
• To update packages in an environment: conda
update [-n env_name] <specific packages> or
conda update [-n env_name] --all
• To uninstall packages: conda remove [-n
env_name] <packages>
• To completely delete an environment: conda
remove -n <env_name> --all
Environments
• Private environments can be shared with
other users in your group
• To be able to use environments created by
your group coleague, create a .condarc file in
your home with the following lines:
• Or just contact us to do it for you!
Using Python through conda
#!/bin/bash
#SBATCH –p std
#SBATCH –N 1
#SBATCH –n 1
module load conda/current
conda activate <your_environment>
python example.py
Using R through conda
#!/bin/bash
#SBATCH –p std
#SBATCH –N 1
#SBATCH –n 1
module load conda/current
conda activate <your_environment>
Rscript example.R
Using pip or CRAN through conda
• It is possible to install Python packages using
pip, or R packages using BioConductor or
CRAN, but it requires configuring a proxy
• Let us know if you need to do this so we can
set up proxy details for you
Best practices
• It is more convenient to designate one person in the group
as environment manager and install/configure everything
on their account
• Avoid clutter; it's better to create multiple single-purpose
environments than one large environment with too many
packages
• Be mindful of version collision when updating
environments; if you don't need to update, don't
• When in doubt, contact us – we can do it for you
https://confluence.csuc.cat/display
/HPCKB/Training

More Related Content

What's hot

resource management
  resource management  resource management
resource management
Ashish Kumar
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
Susant Sahani
 
Centos operating system
Centos operating systemCentos operating system
Centos operating system
Agbada
 
2 gestion de memoria en minix 3
2 gestion de memoria en minix 32 gestion de memoria en minix 3
2 gestion de memoria en minix 3
Jesus Diaz
 

What's hot (20)

Linux OS presentation
Linux OS presentationLinux OS presentation
Linux OS presentation
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
 
Principles of Programming Languages - Lecture Notes
Principles of Programming Languages -  Lecture NotesPrinciples of Programming Languages -  Lecture Notes
Principles of Programming Languages - Lecture Notes
 
Memory Mapping Cache
Memory Mapping CacheMemory Mapping Cache
Memory Mapping Cache
 
resource management
  resource management  resource management
resource management
 
Pipes in Windows and Linux.
Pipes in Windows and Linux.Pipes in Windows and Linux.
Pipes in Windows and Linux.
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
 
GPU power consumption and performance trends
GPU power consumption and performance trendsGPU power consumption and performance trends
GPU power consumption and performance trends
 
Introduction and history of linux
Introduction and history of linuxIntroduction and history of linux
Introduction and history of linux
 
minimization the number of states of DFA
minimization the number of states of DFAminimization the number of states of DFA
minimization the number of states of DFA
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Operating Systems: A History of Linux
Operating Systems: A History of LinuxOperating Systems: A History of Linux
Operating Systems: A History of Linux
 
Automata
AutomataAutomata
Automata
 
Centos operating system
Centos operating systemCentos operating system
Centos operating system
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
2 gestion de memoria en minix 3
2 gestion de memoria en minix 32 gestion de memoria en minix 3
2 gestion de memoria en minix 3
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Linux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating SystemLinux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating System
 

Similar to Conda environment system & how to use it on CSUC machines

Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Aaron Meurer
 

Similar to Conda environment system & how to use it on CSUC machines (20)

Conda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machinesConda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machines
 
Conda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machinesConda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machines
 
Conda environment system & how to use it on CSUC machines
Conda environment system & how to use it on CSUC machinesConda environment system & how to use it on CSUC machines
Conda environment system & how to use it on CSUC machines
 
Conda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machinesConda environment system how to use it on CSUC machines
Conda environment system how to use it on CSUC machines
 
Using Conda in Oracle Data Science.pdf
Using Conda in Oracle Data Science.pdfUsing Conda in Oracle Data Science.pdf
Using Conda in Oracle Data Science.pdf
 
The Conda environment system and how to use it on CSUC machines
The Conda environment system and how to use it on CSUC machinesThe Conda environment system and how to use it on CSUC machines
The Conda environment system and how to use it on CSUC machines
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
 
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Building distribution packages with Docker
Building distribution packages with DockerBuilding distribution packages with Docker
Building distribution packages with Docker
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
Installing Anaconda Distribution of Python
Installing Anaconda Distribution of PythonInstalling Anaconda Distribution of Python
Installing Anaconda Distribution of Python
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
 
anaconda.pptx
anaconda.pptxanaconda.pptx
anaconda.pptx
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelines
 
Top 10 Anaconda Interview Questions and Answers.pptx
Top 10 Anaconda Interview Questions and Answers.pptxTop 10 Anaconda Interview Questions and Answers.pptx
Top 10 Anaconda Interview Questions and Answers.pptx
 

More from CSUC - Consorci de Serveis Universitaris de Catalunya

More from CSUC - Consorci de Serveis Universitaris de Catalunya (20)

Tendencias en herramientas de monitorización de redes y modelo de madurez en ...
Tendencias en herramientas de monitorización de redes y modelo de madurez en ...Tendencias en herramientas de monitorización de redes y modelo de madurez en ...
Tendencias en herramientas de monitorización de redes y modelo de madurez en ...
 
Quantum Computing Master Class 2024 (Quantum Day)
Quantum Computing Master Class 2024 (Quantum Day)Quantum Computing Master Class 2024 (Quantum Day)
Quantum Computing Master Class 2024 (Quantum Day)
 
Publicar dades de recerca amb el Repositori de Dades de Recerca
Publicar dades de recerca amb el Repositori de Dades de RecercaPublicar dades de recerca amb el Repositori de Dades de Recerca
Publicar dades de recerca amb el Repositori de Dades de Recerca
 
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
 
Formació RDM: com fer un pla de gestió de dades amb l’eiNa DMP?
Formació RDM: com fer un pla de gestió de dades amb l’eiNa DMP?Formació RDM: com fer un pla de gestió de dades amb l’eiNa DMP?
Formació RDM: com fer un pla de gestió de dades amb l’eiNa DMP?
 
Com pot ajudar la gestió de les dades de recerca a posar en pràctica la ciènc...
Com pot ajudar la gestió de les dades de recerca a posar en pràctica la ciènc...Com pot ajudar la gestió de les dades de recerca a posar en pràctica la ciènc...
Com pot ajudar la gestió de les dades de recerca a posar en pràctica la ciènc...
 
Security Human Factor Sustainable Outputs: The Network eAcademy
Security Human Factor Sustainable Outputs: The Network eAcademySecurity Human Factor Sustainable Outputs: The Network eAcademy
Security Human Factor Sustainable Outputs: The Network eAcademy
 
The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)
 
Facilitar la gestión, visibilidad y reutilización de los datos de investigaci...
Facilitar la gestión, visibilidad y reutilización de los datos de investigaci...Facilitar la gestión, visibilidad y reutilización de los datos de investigaci...
Facilitar la gestión, visibilidad y reutilización de los datos de investigaci...
 
La gestión de datos de investigación en las bibliotecas universitarias españolas
La gestión de datos de investigación en las bibliotecas universitarias españolasLa gestión de datos de investigación en las bibliotecas universitarias españolas
La gestión de datos de investigación en las bibliotecas universitarias españolas
 
Disposes de recursos il·limitats? Prioritza estratègicament els teus projecte...
Disposes de recursos il·limitats? Prioritza estratègicament els teus projecte...Disposes de recursos il·limitats? Prioritza estratègicament els teus projecte...
Disposes de recursos il·limitats? Prioritza estratègicament els teus projecte...
 
Les persones i les seves capacitats en el nucli de la transformació digital. ...
Les persones i les seves capacitats en el nucli de la transformació digital. ...Les persones i les seves capacitats en el nucli de la transformació digital. ...
Les persones i les seves capacitats en el nucli de la transformació digital. ...
 
Enginyeria Informàtica: una cursa de fons
Enginyeria Informàtica: una cursa de fonsEnginyeria Informàtica: una cursa de fons
Enginyeria Informàtica: una cursa de fons
 
Transformació de rols i habilitats en un món ple d'IA
Transformació de rols i habilitats en un món ple d'IATransformació de rols i habilitats en un món ple d'IA
Transformació de rols i habilitats en un món ple d'IA
 
Difusió del coneixement a l'Il·lustre Col·legi de l'Advocacia de Barcelona
Difusió del coneixement a l'Il·lustre Col·legi de l'Advocacia de BarcelonaDifusió del coneixement a l'Il·lustre Col·legi de l'Advocacia de Barcelona
Difusió del coneixement a l'Il·lustre Col·legi de l'Advocacia de Barcelona
 
Fons de discos perforats de cartró
Fons de discos perforats de cartróFons de discos perforats de cartró
Fons de discos perforats de cartró
 
Biblioteca Digital Gencat
Biblioteca Digital GencatBiblioteca Digital Gencat
Biblioteca Digital Gencat
 
El fons Enrique Tierno Galván: recepció, tractament i difusió
El fons Enrique Tierno Galván: recepció, tractament i difusióEl fons Enrique Tierno Galván: recepció, tractament i difusió
El fons Enrique Tierno Galván: recepció, tractament i difusió
 
El CIDMA: més enllà dels espais físics
El CIDMA: més enllà dels espais físicsEl CIDMA: més enllà dels espais físics
El CIDMA: més enllà dels espais físics
 
Els serveis del CSUC per a la comunitat CCUC
Els serveis del CSUC per a la comunitat CCUCEls serveis del CSUC per a la comunitat CCUC
Els serveis del CSUC per a la comunitat CCUC
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Conda environment system & how to use it on CSUC machines

  • 1. Conda environment system & how to use it on CSUC machines Víctor Pérez 17 / 03 / 2021
  • 2. Index 1. Notice: model transition 2. What is conda? 3. Scope of the project 4. How to use conda 5. Conda environments 6. Package management 7. Python through conda 8. R through conda
  • 3. Notice: model transition • Very important: we are in the process of abandoning shared environments in favour of private environments only • Old shared environments will be available for your old scripts, but won't be modified further • We will clone them as private environments for users and groups who need them
  • 4. Notice: model transition • We will progressively contact users of shared environments to assist you in the "privatisation" of the environments you need • If you already use private environments, simply change the module you load and that's all, no transition needed :) • New live and minimal conda installation: module load conda/current
  • 5. What is conda? • Originally: Anaconda, a distribution of Python including common scientific packages https://www.anaconda.com/ • Extended to include R and R packages, scientific libraries, other software, etc. • conda: core package manager for the Anaconda project
  • 6. What is conda? • conda installs and updates binary versions of Python and R packages from its own (or third party) repositories • It is an alternative to other repository systems, like pip for Python or CRAN for R • It is also a way to manage dependencies for Python and R packages
  • 7. But conda isn't... • A repository of system software packages (such as apt or yum) • A repository of source code • A replacement for environment modules • Exhaustive or infallible
  • 8. Scope of the project • Python • R • Jupyter, Spyder, Rstudio... • NumPy, SciPy, Pandas, Numba, Dask... • Scikit-learn, TensorFlow, Theano... • Matplotlib, Bokeh, Datashader, Holoviews... • A variety of external libraries and tools
  • 9. Conda channels • Channels are thematic collections of packages, useful to avoid version conflicts (equivalent to repositories) • Examples: – pkgs/main: default channel – conda-forge: large collection of third party packages – bioconda: software for bioinformatics – r: tailored to R users
  • 10. How to use conda • We need to load an environment module to configure conda. module load conda/current Obsolete versions for backwards compatibility: module load conda/2 & module load conda/3
  • 11. How to use conda • Then we use the command conda (+ action) to run it: conda list conda activate conda create conda search conda install conda update conda help
  • 12. Conda environments • Inside a given installation of conda, there are a number of environments • Environments are profiles: each will have a different list of packages and versions installed • We are transitioning to working exclusively with private environments owned by users
  • 13. Activating/Deactivating environments • To see a list of environments: conda env list • To load an env: conda activate <env_name> • To unload: conda deactivate
  • 14. Activating/Deactivating environments • To see the contents of an env: conda list [-n env_name] (by default, currently activated environment) • Note: source activate and source deactivate are obsolete
  • 15. Environments • Users can create their own private envs (stored at $HOME/.conda/envs) visible only to them • To create a new empty environment: conda create -n <env_name> • To create a new environment with packages preinstalled in it: conda create –n <env_name> [list of packages]
  • 16. Environments • To install one or more packages in a private env: conda install [-n env_name] <packages> • If no env is specified, they are installed in the currently active environment • Version and channel can also be specified: conda install [-n env_name] [-C channel] <package=version>
  • 17. Environments • To update packages in an environment: conda update [-n env_name] <specific packages> or conda update [-n env_name] --all • To uninstall packages: conda remove [-n env_name] <packages> • To completely delete an environment: conda remove -n <env_name> --all
  • 18. Environments • Private environments can be shared with other users in your group • To be able to use environments created by your group coleague, create a .condarc file in your home with the following lines: • Or just contact us to do it for you!
  • 19. Using Python through conda #!/bin/bash #SBATCH –p std #SBATCH –N 1 #SBATCH –n 1 module load conda/current conda activate <your_environment> python example.py
  • 20. Using R through conda #!/bin/bash #SBATCH –p std #SBATCH –N 1 #SBATCH –n 1 module load conda/current conda activate <your_environment> Rscript example.R
  • 21. Using pip or CRAN through conda • It is possible to install Python packages using pip, or R packages using BioConductor or CRAN, but it requires configuring a proxy • Let us know if you need to do this so we can set up proxy details for you
  • 22. Best practices • It is more convenient to designate one person in the group as environment manager and install/configure everything on their account • Avoid clutter; it's better to create multiple single-purpose environments than one large environment with too many packages • Be mindful of version collision when updating environments; if you don't need to update, don't • When in doubt, contact us – we can do it for you