0

I am using VS Code to execute a python code. I want to automate this windows task scheduler, however i am getting an error.

from VSCode this is what I see on terminal when I run the script;

Loading personal and system profiles took 712ms
(base) PS C:\Users\tableauautomation\Desktop\Python>  & 'C:\Users\tableauautomation\Anaconda3\python.exe' 'c:\Users\tableauautomation\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy\launcher' '64388' '--' 'c:\Users\tableauautomation\Desktop\Python\ForecastAutomation.py'
job Started: 2020-07-26 18:13:30

i am creating this in Notepad saved as bat but keep getting errors like Numpy or Panda's is not installed.

batchfile has this; call activate my_env "c:\Users\tableauautomation\Desktop\Python\ForecastAutomation.py" pause

Screenshot

2 Answers 2

1

write the below lines in your notepad with .bat format.

call activate [my_env]
python c:\Users\tableauautomation\Desktop\Python\ForecastAutomation.py
call conda deactivate

if absolute path of python is not included in $PATH then use absoulte path of python.exe in .bat file.

call activate [my_env]
c:\Users\tableauautomation\Anaconda3\python.exe c:\Users\tableauautomation\Desktop\Python\ForecastAutomation.py
call conda deactivate
Sign up to request clarification or add additional context in comments.

Comments

0

Anyone else have this issue the solution is here; The batchfile needs the following parameter (Windows Machine)

cmd /c C:\Users\tableauautomation\Anaconda3\condabin\conda.bat run "C:\Users\tableauautomation\Anaconda3\python.exe" "c:\Users\tableauautomation\Desktop\Python\ForecastAutomation.py" pause

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.