프로그램 설치 및 환경설정/conda

conda 가상환경 설정

LiaLi_1997 2022. 7. 20. 17:16

OS : ubuntu20.04 --> Docker Ubuntu20.04, nvidia/cuda image

 

1. 아나콘다 설치

pip install conda

2. 가상환경 생성

conda create -n 가상환경이름 python=python버전

3. 가상환경 확인

conda info --envs

4. 가상환경 사용

conda activate 가상환경이름

5. 가상환경 해제(기존 base 환경으로)

conda deactivate

6. conda library 설치

# 현재의 터미널 상태가 내가 원하는 conda 환경일 때
conda install 라이브러리이름
# conda 가상환경으로 들어가지 않은 base 환경일 때
conda install -n 가상환경이름 라이브러리이름

7. 라이브러리 설치 확인

conda list

8. 콘다 특정 라이브러리 삭제

 conda remove 라이브러리이름

9. 콘다 가상환경 삭제

conda env remove --n <가상환경이름>

10. 콘다 Import / Export

# import
conda env create -f '파일명'
# example
conda env create -f opensmile

#export
conda activate "conda 환경 이름"
conda env export > "파일이름.yaml"
#example
conda activate opensmile
conda env export > opensmil.yaml