Introduction on How to Use Conda

Anaconda is distribution software that provides a collection of packages written in Python and R programming languages in the scientific computing field (e.g., data science, machine-learning application programs, large-scale data processing, and predictive analytics).

The Anaconda distribution has over 12 million users and includes over 1,400 popular data science packages suitable for Windows, Linux, and MacOS.

To install Anaconda, you can download and install the distribution suitable for your OS from the website: https://www.anaconda.com

(Example) Windows, MacOS, Linux

Currently, Anaconda has a version based on Python 3.7 and one based on Python 2.7.

Conda is an application provided to manage package versions in Anaconda.

By using conda, the dependency problem with which Python users have the most difficulty when installing packages can be solved easily.

This document introduces the method for using the conda package in the KISTI system for Python users.

The "/home01/userID" directory on the introduction page is the home directory of the test account. Therefore, the directory should be changed to the path that is appropriate for a user.

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

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

info

Display information about the current conda installed.

init

Initialize conda for shell interaction. [Experimental]

install

Install 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, which is a query language for conda packages.

See examples below.

update

Updates conda packages to the latest compatible version.

upgrade

Alias for conda update.

B. Create Conda Environment

  • The conda environment creates an independent virtual execution environment for Python, so different versions of packages can be easily managed.

  • You can create a conda environment using "conda create -n [ENVIRONMENT]."

  • The conda environment is created with the environment name specified in the path under envs of the conda path by default.

  • If the "--use-local" option is used, the conda environment is created in the user’s home directory (${HOME}/.conda/envs/[environment_name]).

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]".

  • Packages are installed under the conda environment path created in Section "2" above.

D. Check Conda Environment List

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

E. Remove Conda Environment

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

F. 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 conda environment in another system by using "conda pack -n [ENVIRONMENT] -o [file name]."

(Example) When the external Internet is not connected, when the same conda environment is used in another system

G. 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.

2022년 9월 15일에 마지막으로 업데이트되었습니다.

Last updated