Conda

Anaconda is a distribution that provides a collection of packages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.) in the Python and R programming languages.

Anaconda distribution is used by over 12 million users and includes more than 1,400 popular data science packages suitable for Windows, Linux, and MacOS.

To install Anaconda, visit the https://www.anaconda.com website and download the version appropriate for your OS (e.g., Download and install the appropriate distribution for your OS (Windows, MacOS, Linux)

Currently, Anaconda offers versions based on Python 3.7 and Python 2.7.

Conda is an application provided by Anaconda for managing package versions.

Conda helps Python users easily resolve dependency issues, which are often encountered during package installation.

This document introduces how to use Conda packages on the KISTI system for Python users.

The "/home01/userID" on the introduction page is the home directory for a test account. Modify it to the appropriate path for use.

A. Use of Conda

  • For Miniconda, you can download a version suitable for each OS from the website: https://docs.conda.io/en/latest/miniconda.html

  • For Anaconda, you can download a version suitable for each OS from the website: https://www.anaconda.com/distribution/#download-section

Command
Description

clean

Remove unused packages and caches.

config

Modify configuration values in .condarc.

This is modeled after the git config command.

Writes to the user .condarc file (/home01/userID/.condarc)

by default.

create

Create a new conda environment from a list of specified packages.

help

Displays a list of available conda commands and their help strings.

info

Display information about current conda install.

init

Initialize conda for shell interaction. [Experimental]

install

Installs a list of packages into a specified conda environment.

list

List linked packages in a conda environment.

package

Low-level conda package utility. (EXPERIMENTAL)

remove

Remove a list of packages from a specified conda environment.

uninstall

Alias for conda remove.

run

Run an executable in a conda environment. [Experimental]

search

Search for packages and display associated information.

The input is a MatchSpec, a query language for conda packages.

update

Updates conda packages to the latest compatible version.

upgrade

Alias for conda update

  • How to Initialize Conda You can add settings to the .bashrc file in your home directory using the conda init command.

  • How to Change the Conda PathThe conda environment and package paths are set to the home directory by default, but they can be changed to other paths, such as scratch.

B. Create Conda Environment

  • A conda environment creates an independent virtual execution environment for Python, making it easy to manage package versions.

  • You can create a conda environment using the command conda create –n [ENVIRONMENT].

  • By default, the environment will be created under the envs path in the conda directory with the name you specify.

- Example -

C. Install and Check Packages in Conda Environment

  • Packages can be installed using conda install [package name]

  • Packages in the conda channel can be installed using "conda install -c [channel name] [package name]".

  • The above item ("B. Creating a Conda Environment") is where the packages will be installed under the path of the conda environment created.

- Example -

D. Check Conda Environment List

  • You can check the conda environment list using "conda-env list" or "conda env list."

- Example -

E. Export Conda Environment

  • The conda-pack package is required before exporting a conda environment.

※ (Reference) https://conda.github.io/conda-pack

  • You can use the command "conda pack -n [ENVIRONMENT] -o [file name]" to utilize a conda environment on a different system.

(Example) When you need to use the same conda environment on a system that is not connected to the internet or when the same environment is required on another system without reinstalling, you can export the conda environment as shown below.

- Example -

F. Import Conda Environment

  • You can import the conda environment that was created using conda pack, as shown in the example below, and use it after setting the environment.

- Example -

G. Deleting a Conda Environment

  • You can delete a conda environment using either "conda-env remove -n [ENVIRONMENT]" or "conda env remove -n [ENVIRONMENT]".

- Example -

Last updated on November 08, 2024.

Last updated