dukongmon

[Anaconda] 리눅스 서버 CUDA 버전에 맞춰 Anaconda 설치 본문

etc./Server

[Anaconda] 리눅스 서버 CUDA 버전에 맞춰 Anaconda 설치

duiiminish 2026. 4. 24. 17:49

 

 

 

내 작업 환경

- cuda ver : 11.4

- Python ver : 2.7.17

- ubuntu ver : 18.04


 

 
1. 설치할 서버에 접속해서 cuda 버전과 파이썬 버전 확인
ssh 사용자이름@서버주소 # 서버접속
nvidia-smi # cuda 버전 확인
python --version # 파이썬 버전 확인
 
 

 

2. anaconda archive에서 cuda 버전과 호환되는 anaconda 확인

 

https://repo.anaconda.com/archive/

 

Index of /archive

 

repo.anaconda.com

 

여기서 가장 오래걸렸는데 내 cuda 버전과 호환되는 anaconda가 뭔지 도통 모르겠었음.

검색해도 잘 안나오고 그래서 갓gpt한테 물어봄

 

 

chat gpt에 위와 같이 질문하니 호환되는 모델을 알려주었고, 저는 이 기준으로 anaconda 버전 선택했습니다.

linux 서버에 설치할 것이기 때문에 'Anaconda3-2021.05-Linux-x86_64.sh' 로 선택했습니다.

 

 

 

3. 서버에서 anconda 다운로드

 

다시 서버로 돌아와 다운로드 코드를 날려줍니다.

wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh # ancaconda 다운로드
# 예시 : wget https://repo.anaconda.com/archive/Anaconda3-<버전>.sh
 
 

 

4. 다운로드 확인

 

다운로드가 완료되면 ls 명령어를 날려서 잘 다운로드가 되었는지 확인합니다.

ls # 현 위치에서 내용물 확인
 

 


 

5. anaconda 설치

 

다운로드를 확인했으면 이제 파일을 실행시켜줍니다.

bash Anaconda3-2021.05-Linux-x86_64.sh # anaconda 설치 파일 실행
 

코드를 날려주면 이후로 엄청 긴 설명이 나오는데 엔터 꾹 누르고 있으면 빠르게 넘어갑니다.

 

설명이 끝나면 라이센스 수락과 설치 위치에 관한 질문을 하는데 각각 yes 입력, enter 눌러주시면 됩니다.

Welcome to Anaconda3 2021.05

...

Do you accept the license terms? [yes|no]    # 라이센스 수락
>>> yes

Anaconda3 will now be installed into this location:    # 저장 위치 설정
/home/julie99/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below
>>> 엔터 누름

...

Thank you for installing Anaconda3!
 

설치가 끝나면 어쩌고 저쩌고 설치 감사합니다! 메시지 나옵니다.

 

메시지 확인하면 설치가 잘 되었는지 anaconda 폴더 확인해줍니다.

cd anaconda3 && ls
 

그럼 설치내역들이 쭉 보입니다.


6. 설치 확인

 

이제 실행시켜보려고 local에서 사용했던 익숙한 activate 명령어를 날렸더니 conda를 못찾는다고 합니다.

검색해서 찾은 source ~/.bashrc 명령어를 날려보니 잘 실행되었습니다.

https://wikidocs.net/27610 참고

# conda activate -> local에서는 되는데 왜 여기서는 안되는건지 모르겠음
>conda: command not found

source ~/.bashrc # 이 코드 날리면 conda 활성화됨
 

이후에 원하는 cuda 버전의 conda가 잘 설치되었는지 확인해줍니다.

conda --version
nvidia-smi