개발환경

우분투 22.04에 conda 가상환경 설치하기

감자156 2023. 4. 13. 00:54
반응형

0. 기본 업데이트

sudo apt-get update

 

1. conda 설치 파일(sh) 다운받고 설치

아나콘다 홈페이지에 들어가서 본인 OS에 맞는 최신 버전을 다운받기

 

https://www.anaconda.com/products/distribution#Downloads

 

Anaconda | Anaconda Distribution

Anaconda's open-source Distribution is the easiest way to perform Python/R data science and machine learning on a single machine.

www.anaconda.com

안되면 아래 링크~ 

https://www.anaconda.com/

 

2. 다운받은 파일 실행하여 설치

cd ~/Downloads
bash Anaconda3-xxxxxx

설치 과정에서 라이센스 동의, 기본 환경변수 path 설정, 등등을 묻는데 따로 설정할 것 아니라면 yes나 엔터

 

3. 환경변수 셋팅

설치 완료되면, 터미널 재시작 후

source ~/.bashrc

 

4. 터미널 시작시 자동시작하지 않게 설정 (default : True)

conda config --set auto_activate_base False

 

5. 새로운 가상환경 설치하기

conda create -n 가상환경이름

#가상환경 활성화
conda activate 가상환경이름
#가상환경 비활성화
conda deactivate

 

ref)

https://docs.anaconda.com/anaconda/install/linux/

 

Installing on Linux — Anaconda documentation

Note If you install multiple versions of Anaconda, the system defaults to the most current version, as long as you haven’t altered the default install path.

docs.anaconda.com

 

반응형