Anaconda: Difference between revisions

From NU HPC Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Anaconda ==
'''Description:''' Anaconda, also known as "conda," is a tool for managing Python packages. It helps you create virtual environments for different Python and package versions. You can use Anaconda to install, remove, and update packages within your project environments. For instance you can create virtual environment for game development which requires Pygame with version of Python and you can create environment for machine learning which requires Pytorch with new version of Python. 


== Anaconda[edit | edit source] ==
'''Usage:''' module load Anaconda3/2022.05
'''Description:''' Anaconda, also known as "conda," is a tool for managing Python packages. It helps you create virtual environments for different Python and package versions. You can use Anaconda to install, remove, and update packages within your project environments. For instance you can create virtual environment for game development which requires Pygame with version of Python and you can create environment for machine learning which requires Pytorch with new version of Python.
 
'''Usage:''' module load Anaconda3/2022.05


'''Working with Anaconda environments'''
'''Working with Anaconda environments'''


Below is a list of main commands you should use in order to start working with Anaconda.
Below is a list of main commands you should use in order to start working with Anaconda.
# To Check available environments, please type: <code>conda env list</code>
# To Check available environments, please type: <code>conda env list</code>
# View a list of packages in an environment
# View a list of packages in an environment
Line 18: Line 16:
#* Create an environment to target directory: <code>conda create -p /shared/home/{username}/.conda/envs/virtualenv</code>
#* Create an environment to target directory: <code>conda create -p /shared/home/{username}/.conda/envs/virtualenv</code>
# Activate an environment: <code>source activate virtualenv</code>
# Activate an environment: <code>source activate virtualenv</code>
# Deactivate an environment: <code>conda deactivate</code>
# Deactivate an environment: <code>conda deactivate</code>
# Remove an environment
# Remove an environment
<code>conda remove -n virtualenv --all</code> or <code>conda env remove -n virtualenv</code>
<code>conda remove -n virtualenv --all</code> or <code>conda env remove -n virtualenv</code>


Line 32: Line 29:
* If you need to install package with specific version: <code>conda install numpy=1.15.2</code>
* If you need to install package with specific version: <code>conda install numpy=1.15.2</code>


'''External links'''
'''External links'''


Documentation
[https://docs.conda.io/projects/conda/en/latest/ Documentation]


User Guide
[https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html User Guide]


Video
[https://www.youtube.com/watch?v=23aQdrS58e0 Video]


Conda Cheat Sheet
[https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf Conda Cheat Sheet]

Revision as of 04:06, 3 July 2024

Anaconda

Description: Anaconda, also known as "conda," is a tool for managing Python packages. It helps you create virtual environments for different Python and package versions. You can use Anaconda to install, remove, and update packages within your project environments. For instance you can create virtual environment for game development which requires Pygame with version of Python and you can create environment for machine learning which requires Pytorch with new version of Python.

Usage: module load Anaconda3/2022.05

Working with Anaconda environments

Below is a list of main commands you should use in order to start working with Anaconda.

  1. To Check available environments, please type: conda env list
  2. View a list of packages in an environment
    • If the environment is not activated, please type: conda list -n virtualenv
    • If the environment is activated, then type: conda list
  3. Create Conda environment
    • Create an environment: conda create -n virtualenv
    • Create an environment with a specific Python version: conda create -n virtualenv python=3.12
    • Create an environment to target directory: conda create -p /shared/home/{username}/.conda/envs/virtualenv
  4. Activate an environment: source activate virtualenv
  5. Deactivate an environment: conda deactivate
  6. Remove an environment

conda remove -n virtualenv --all or conda env remove -n virtualenv

Working with packages

Install packages into virtualenv environment

  • If the environment is not activated, please type: conda --name virtualenv install PACKAGENAME
  • If the environment is activated, please type: conda install PACKAGENAME
  • If you want to install multiple packages at once: conda install pkg1 pkg2 pkg3
  • If you need to install package with specific version: conda install numpy=1.15.2

External links

Documentation

User Guide

Video

Conda Cheat Sheet