Nam's

[zsh] Mac os zsh에서 conda 환경변수 설정 본문

개발

[zsh] Mac os zsh에서 conda 환경변수 설정

namespace 2021. 4. 18. 19:02
export PATH="/Users/username/anaconda/bin:$PATH"

conda 설치 후 conda를 사용하기 위해서는 ~/.zshrc 파일을 열어서 위 명령어를 추가해줘야한다.

그 다음 source 해주면 된다.

source ~/.zshrc

Error01: CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

conda env list는 되는데, activate가 안되는 경우 

source ~/opt/anaconda3/etc/profile.d/conda.sh

# opt 폴더 경로가 ~/opt 아니라 /opt 일 수 있습니다.

source [아나콘다경로]/etc/profile.d/conda/sh 를 해줘야한다.

하지만 터미널을 껐다 다시 키면 같은 문제가 반복 된다.

이 경우에는 위 코드를 ~./zshrc 에 추가해주면 해결된다.

Error02: Insecure completion-dependent directories detected:

[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 rafael  admin  88 Apr 28 15:51 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

만약 위와 같은 에러가 뜬다면 두가지 해결 방법이 있다. 참고: github.com/ohmyzsh/ohmyzsh/issues/6835

1. 해당 파일들의 권한을 수정해주거나

chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions

2. "Set ZSH_DISABLE_COMPFIX=true" 명령어 zshrc 파일에 추가해주는 방법이다.

Set ZSH_DISABLE_COMPFIX=true

 

어떤 방법이 좋은 지는 잘 모르겠는데, 혹시 아시는 분 계시다면 댓글남겨주세요...ㅎ

Comments