Running a basic python script with the windows task scheduler only works when I comment out the import statement for numpy and I can't figure out why.
Details:
I was previously trying to run a more complex script but in order to narrow down the issues I was having I ended up creating the following basic script to test run with the task scheduler.
import numpy
outDIR = "C:\\Users\\trill_gates\\OneDrive\\Documents\\DS Projects\\"
f = open(outDIR + "demofile2.txt", "w")
f.write("Test Text")
f.close()
Running the script normally does not produce any issues. However, when I set it up to run with task scheduler, the file its supposed to write to isn't created. Only when the import numpy
statement is commented out does it work again. In the proper script I need run on a schedule, I'm using numpy and that seems to also be what was causing the script to not run. I tried this on two separate computers, uninstalled and reinstalled anaconda as well as created a clean conda environment with just the necessary packages and I'm still getting the same error.
This is the setup I'm using in task scheduler to call the script.
I'm using an anaconda distribution of python 3.7.7 and numpy 1.18.5.
Any help would be appreciated.