[Python] Anaconda 가상환경 셋팅하기

Minjeong Park·2022년 3월 6일
0

Python

목록 보기
5/7

가상환경 생성

conda create --name [name]

# ex) conda create --name MeanScaleHyperPrior

가상환경 실행

activate [name]

가상환경 종료

deactivate [name]

Python 설치

conda install python=[version]

# ex) conda install python=3.7

requirements.txt 설치

pip install -r requirements.txt

ERROR: Could not find a version that satisfies the requirement torch>=1.0 (from versions: none)
ERROR: No matching distribution found for torch>=1.0

위와 같은 에러가 발생한다면, 파이썬 버전을 낮춰야함.

파이썬 버전 낮추기

conda install python=[lower version]

requirements.txt 만들기

requirements.txt를 만들어서 배포하면, 다른 사람들도 똑같은 버전의 모듈을 사용할 수 있다.

conda env export > requirements.txt

위와 같은 방법으로 했을 때 이상한 게 낀다면,

pip freeze > requirements.txt

를 해주면 된다.

profile
아자아잣

0개의 댓글