Come on IT/Linux-Ubuntu
Ubuntu 22.04에 Anaconda 설치 및 가상환경 세팅
JONGSKY
2022. 12. 17. 15:53
728x90
반응형
SMALL
1. 글을 작성하게 된 계기
새로운 프로젝트를 할 때마다 Anaconda를 설치해서 환경 세팅을 하는 경우가 많다.
매번 구글링해서 설치하곤 하는데 정리해서 새로운 환경에서 시작할 때 참고하고자 한다.
2. Ubuntu 22.04에 Anaconda 설치 방법
1단계 : apt update 하기
sudo apt update
2단계 : curl 패키지 설치
sudo apt install curl -y
3단계 : Anconda 설치 (참고)
curl --output anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
sha256sum anaconda.sh
bash anaconda.sh
4단계 : conda 명령어 환경변수 추가
sudo vi ~/.bashrc
마지막 줄에 추가 후 (:wq로 저장 후 빠져나오기)
export PATH=~/anaconda3/bin:~/anaconda3/condabin:$PATH
환경변수 내용 적용(업데이트)하기
source ~/.bashrc
5단계 : conda 잘 설치되었는지 확인
conda -V
6단계 : 가상환경 설치 (가상 환경 이름 : python_3 / python 버전 : 3.9)
conda create -n python_3 python=3.9
7단계 : 가상환경 실행
conda activate python_3
만약 IMPORTANT: You may need to close and restart your shell after running 'conda init'. 과 같은 에러가 난다면
profile 변경 값을 conda shell script 파일에 적용시킨다.
source ~/anaconda3/etc/profile.d/conda.sh
728x90
반응형
LIST