LoginSignup
1
0

More than 3 years have passed since last update.

スパコン上でconda の仮想環境をactivateする際にCommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.時のメモ

Posted at

状況

スパコン上でqiime2というbioinfoのソフトウェアを動かすためにqiime2用のcondaの仮想環境作ってそこに入ろうとすると

以下のようにCommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.がでた。

image.png

エラー文に従って、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 の反映において自分の行いたい処理が反映されていないかった?

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0