AnsweredAssumed Answered

Import arcpy and Windows Task Scheduler

Question asked by rknapik_orsip on Aug 18, 2018
Latest reply on Aug 21, 2018 by rknapik_orsip

I have problem with Task Scheduler in Windows Server 2012. I would like to run script in Task Scheduler in which I use arcpy. Unfortunately when I use arcpy in my script Task Scheduler does not work correctly.

I have following test script which print current Python version: 


   import platform
   import os
   import sys
   import datetime
   import arcpy


   filename = os.path.join(os.path.dirname(sys.argv[0]), 'plik.txt') #zapis do folderu ze skryptem
   fid = open(filename, 'a')


When I delete line with "import arcpy" everything is ok. 


Does anyone know how to solve this problem?