Your shell has not been properly configured to use 'conda activate'

conda的路徑要正確寫入.bashrc, 不然下一次會報錯conda : command no found

lchen@Vostro-5460:~$ echo 'export PATH="/home/lchen/miniconda3/bin:$PATH"' >> ~/.bashrc
lchen@Vostro-5460:~$ source ~/.bashrc
lchen@Vostro-5460:~$ conda activate rna

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


lchen@Vostro-5460:~$ source activate
(base) lchen@Vostro-5460:~$ conda activate rna
(rna) lchen@Vostro-5460:~$

出現(xiàn)此報錯的原因是因為之前的虛擬環(huán)境沒有退出source deactivate

良好習慣:

啟用conda進入虛擬環(huán)境:
lchen@Vostro-5460:~$ source activate
(base) lchen@Vostro-5460:~$ conda activate rna
(rna) lchen@Vostro-5460:~$ 
用完conda后退出虛擬環(huán)境:
source deactivate

參考: [Tz.]conda激活環(huán)境失敗,Your shell has not been properly configured to use 'conda activate'.

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內(nèi)容