[Linux/Anaconda] 다른 서버 가상환경 세팅 추출하기. Conda environment export 하기

잠만보 석사생·2022년 7월 8일
0

서버1 에서 서버2로 conda 가상환경 export/추출하기


# example

# 콘다 가상환경이 pytorchenv 라고 예시를 들었을떄:
(pytorchenv)ryan@server123: 

pip freeze > requirements.txt

아래와 같이 requirements.txt라는 파일이 추출된다.

1. 서버간 requirements.txt를 이동하기

scp [옵션] [파일명] [원격지 id]@[원격지 ip]:받는 위치

txt file이나 단순 파일을 옮길때는

scp requirements.txt ryan@123.123.123.123:/home/ryan/

2. 옮긴 requirements.txt 파일을 새로운 가상환경에 설치


pip install -r requirements.txt

가끔 에러가 뜰 때가 있는데, 그럴때는 requirements.txt들어가서 버전안맞는거는 지우거나 error가 떴을때 거기에맞는 버전으로 requirements.txt를 수정하면 된다.

profile
생명공학을 전공했지만 AI에 관심있는 사람

0개의 댓글