Python Anaconda: should I use `conda activate` or `source activate` in linux

前端 未结 3 2039
清歌不尽
清歌不尽 2021-01-30 20:43

So I am used to typing source activate when starting a python Anaconda environment. That works just fine. But when I create new conda environmen

3条回答
  •  被撕碎了的回忆
    2021-01-30 20:50

    Here is one difference I found. source activate can be used at the beginning of a bash script to load conda environment, whereas conda activate would give me an error:

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

    This makes a huge difference to me since I often submit bash jobs to cluster and source activate is the only way to change conda environment.

    Please correct me if anyone can use conda activate in a bash script.

提交回复
热议问题