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

后端 未结 2 1593
梦毁少年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条回答
  • 2020-12-28 19:51

    If conda is on your path:

    source activate <env name> && 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

    0 讨论(0)
  • 2020-12-28 19:59

    Actually, you can do exactly the same as in venv in miniconda. If path_to_miniconda is your installation dir of miniconda, then

    /path_to_miniconda/envs/name_of_env/bin/python xxx.py

    should work.

    0 讨论(0)
提交回复
热议问题