I am trying to run a python script that downloads qualtrics survey responses and stores it as a CSV. As part of the script it calls zipfile.zipfile. When i run the program inside of VS Code Terminal window it downloads and unzips the file just fine. However when I run the script in Windows Task Scheduler i run into this error.
<class 'PermissionError'>
Traceback (most recent call last):
File "C:\Users\sdr-research\Dropbox (PCC)\SDR6\Qualtrics_Data\QualtricsSurveyResponses\mindshareResponsesPull.py", line 54, in <module>
zipfile.ZipFile(io.BytesIO(requestDownload.content)).extractall("C:\\Users\sdr-research\Dropbox (PCC)\SDR6\Qualtrics_Data\QualtricsSurveyResponses")
File "C:\Python36\lib\zipfile.py", line 1501, in extractall
self._extract_member(zipinfo, path, pwd)
File "C:\Python36\lib\zipfile.py", line 1555, in _extract_member
open(targetpath, "wb") as target:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\sdr-research\\Dropbox (PCC)\\SDR6\\Qualtrics_Data\\QualtricsSurveyResponses\\Mindshare English v2.1.csv'
I am running python 3.6, windows 10, i have tried changing the user permissions from my logged in account the administrator's, placing the file's path in as the program to run, placing python.exe as the program to run and the file's path as the first argument with and without the folder the file is located in as the "start in" parameter. I make sure when i put in the file name into the task scheduler i put quotations around the path because there is a space in the path.
Any ideas?