Conda环境和.BAT文件 [英] Conda environments and .BAT files

查看:78
本文介绍了Conda环境和.BAT文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过BAT文件和Windows Task Scheduler设置对python(Anaconda发行版)的调用.

I am setting up calls to python (Anaconda distribution) via BAT files and the windows task scheduler.

我现在是第一次使用环境,并尝试如下设置 .bat 文件:

I've now used environments for the first time and was trying to set a .bat file up as below:

activate [my_env]
python my_script.py
deactivate

不幸的是,似乎第二条命令没有执行.

Unfortunately it appears that the second command does not get executed.

推荐答案

在激活/禁用环境时使用'call'命令.

Use the 'call' command when activating/deactivating the environment.

call activate [my_env]
python my_script.py
call conda deactivate

请参见 https://github.com/conda/conda/issues/794

这篇关于Conda环境和.BAT文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆