calling conda source activate from bash script

后端 未结 3 1797
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 07:25

I\'m trying to activate my conda env via a bash script. Even though the script runs fine and my PATH appears to be changed within the script, it\'s getting reset somehow aft

3条回答
  •  伪装坚强ぢ
    2020-12-09 07:58

    I have found the following to work on Mac OSX running a bash shell:

    #!/bin/bash
    source /Users/yourname/anaconda/bin/activate your_env
    python --version # example way to see that your virtual env loaded as expected
    

    Make sure you make the scripted executable with:

    chmod +x yourscript.bash
    

提交回复
热议问题