Thursday 28 February 2019

PermissionError: [Errno 13] for df.to_csv() when running python script in cmd

I have a python script where at one point I save a temporary file locally:

df.to_csv(temp_file_name)

This works fine when I run it in Pycharm.

However, when I schedule it as a batch in task scheduler (or if I manually open it with cmd and run it). I basically tell the Task Scheduler to open the program:

C:\Windows\System32\cmd.exe

And Add arguments:

/c C:\Github\project_folder\venv\Scripts\activate.bat && python C:\Github\project_folder\daily_main.py

However, I get the error at the line above:

PermissionError: [Errno 13] Permission denied: 'CLOSE'

where CLOSE is actually a column in my df. What is happening and how to resolve it?



from PermissionError: [Errno 13] for df.to_csv() when running python script in cmd

No comments:

Post a Comment