본문 바로가기

카테고리 없음

How to activate conda venv in git bash

질문 : Can't execute 'conda activate' from bash script

출처 : 

https://github.com/conda/conda/issues/7980

 

Can't execute `conda activate` from bash script · Issue #7980 · conda/conda

Current Behavior Trying to use conda activate my_env does not work inside a bash script. The workaround is to use source activate my_env but this shouldn't be necessary. Steps to Reproduce Writ...

github.com

git bash와 같은 bash script에서 conda 가상환경을 activate하는 방법에 대해 조사 중에 윗 글을 발견했다.

 

답변

 

아래 답변을 보고 해결이 되어 공유하고자 한다.

https://github.com/conda/conda/issues/7980#issuecomment-441358406

 

 

source ~/anaconda3/etc/profile.d/conda.sh
conda activate my_env

 

내 경우, ~/anaconda3/etc/profile.d/에 들어가보니 conda.csh 파일이 있서 그렇게 수정해주었더니,

 

다 뭐 commad not found라서 잘 안되나 싶었는데 

어찌됐든 activate 되었다.