I am trying to schedule a Github repo in conda ssf environment of python using windows scheduler.
I checked this link A python script in virtual environment from windows task scheduler, but I cannot run it.
Queries: Where do I save the bat file?
Also, will it open the conda ssf environment and then run the script?
First you need to add Anaconda path to the environment variable. anaconda base path
and <anaconda base path>/Scripts
to the environment variable.
Then you can execute conda commands through your cmd
next step is writing the batch file.when your batch file is running there are few things to execute
batch file look like this
@ECHO on
call <anaconda_dir>\Scripts\activate.bat
call activate <environment name>
"C:\Program Files\python\Python.exe" "<path to your script\script.py"
PAUSE
notes - you can save bat file anywhere if you specified absolute path in "<path to your script\\script.py"
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.