카테고리 없음
zsh로 변경하고 anaconda가 안될때
cozynow
2021. 1. 3. 06:50
노트북 셋팅을 하면서 zsh을 다시 설치하고, anaconda를 설치하였다.
그런데 갑자가 prompt에 anaconda환경 상태가 사라졌다.
해결방법
사실 이것은 anaconda 명령어 도움말만 확인하면 알 수 있다.
- 문제의 prompt
akami@akamiui-MacBookPro %
- 해결된 prompt
(base) akami@akamiui-MacBookPro %
- 해결 방법 : 아래와 같이 init 명령어는 shell이 변경되면 초기화 해줘야 하는 옵션
(base) akami@akamiui-MacBookPro % conda ~
usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options:
positional arguments:
command
clean Remove unused packages and caches.
compare Compare packages between conda environments.
config Modify configuration values in .condarc. This is modeled after the git config command. Writes to
the user .condarc file (/Users/akami/.condarc) by default.
create Create a new conda environment from a list of specified packages.
help Displays a list of available conda commands and their help strings.
info Display information about current conda install.
init Initialize conda for shell interaction. [Experimental]
- 실제로 ~/.zshrc 에는 아래의 스크립트가 추가된다.
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/akami/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/akami/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/akami/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/akami/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<