which activate
/path/anaconda3/bin/activate
test
你需要定时运行的 shell 脚本,顶部加入如下代码
#!/bin/bash source /path/anaconda3/bin/activate test # below your_run_code .....
参考: https://blog.csdn.net/lianggx6/article/details/87981240