I'm trying to use Windows Task Scheduler to run a script in python and write a csv file. I've always used Anaconda, so I don't understand how Python's command line works. If I run this on Spyder,
import pandas as pd
import datetime
now_is = pd.DataFrame(['Now is '+ str(datetime.datetime.now())])
now_is.to_csv('C:/Users/camila/now_is.csv')
it works perfectly. But Task Scheduler executes this .py using the command terminal, where this code won't work.
I guess I need to install pandas again, but I can't even get pip to work on this...
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> pip.__version__
'9.0.1'
>>> pip install pandas
File "<stdin>", line 1
pip install pandas
^
SyntaxError: invalid syntax
>>>
- How can I schedule a script developed in Anaconda on Windows Task Scheduler?
- How can I import the modules that I have in Anaconda in the command line?
pip
on Windows, you should run it in the Windows console (sometimes called the command-line prompt) — not from the Python console. – Thisbee