Use anaconda environment without activate? (e.g. in Crontab)

后端 未结 2 1592
梦毁少年i
梦毁少年i 2020-12-28 19:19

Being reading this

http://conda.pydata.org/docs/using/envs.html

Is it possible to run a conda python directly without having to source activate xxx

2条回答
  •  旧时难觅i
    2020-12-28 19:51

    If conda is on your path:

    source activate && python xxx.py && source deactivate

    If conda isn't on your path but is installed:

    source /path/to/conda/bin/activate /path/to/desired/env_name/ && python xxx.py && source deactivate

提交回复
热议问题