conda 切換環(huán)境以前是source <env>
更新后變成了 conda <env>
但是更新后有個問題骡和,就是當(dāng)你把conda寫進(jìn)shell里,會報(bào)錯:
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'.
直接運(yùn)行崭参,不寫到shell里倒是沒問題。不過裝了很多軟件后款咖,早就忘了哪些軟件是用conda裝的了何暮,這時就需要我們把conda包裝到腳本里,讓運(yùn)行時自己運(yùn)行conda铐殃,這樣busco就是我們包裝后的腳本了:
#run busco
#!/usr/bin/bash
conda activate busco
export AUGUSTUS_CONFIG_PATH="/biosoft/anaconda2/envs/busco/config"
export BUSCO_CONFIG_FILE="/biosoft/anaconda2/envs/busco/config/config.ini"
/biosoft/anaconda2/envs/busco/bin/busco_run $@
看來這個報(bào)錯是一定要解決的海洼,在網(wǎng)上看了很多方式,比如先source activate富腊、加環(huán)境變量等等坏逢,對于目前的conda來說都已經(jīng)無效了。
最后還是在github上的一個方法解決了:https://github.com/facebookresearch/demucs/issues/18
就是找到你的conda.sh赘被,然后source一下是整,相當(dāng)于重置當(dāng)前conda的環(huán)境變量
#!/usr/bin/bash
source /biosoft/anaconda2/etc/profile.d/conda.sh
conda activate busco
... ...
解決。