状況
スパコン上でqiime2というbioinfoのソフトウェアを動かすためにqiime2用のcondaの仮想環境作ってそこに入ろうとすると
以下のようにCommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
がでた。
エラー文に従って、conda init bash
を行い、ログインし直したものの改善されなかった
最終的な解決方法
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/keiya/workspace/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/keiya/workspace/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/keiya/workspace/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/keiya/workspace/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
を.bashrc_tmp に追記してsource .bashrc_tmp を行った
考えられる原因?
conda init において自動的に.bashrc を参照し実行するが、私の環境では.bashrcに重い処理をおくとログイン時に自動で行われる処理が重くなることから.bashrcには処理を書かず、.bashrc_tmp に記入し毎回ログインするために自動でsourceをしていた。
そのため、conda init で行われる .bashrc の反映において自分の行いたい処理が反映されていないかった?