<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Model / Script works in ArcMap but doesn't run when in Windows Scheduler in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/model-script-works-in-arcmap-but-doesn-t-run-when/m-p/201580#M15506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I' ve created a model that updates a table in PostgreSQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The model runs perfectly as model and as tool as well.&lt;/P&gt;&lt;P&gt;Exported the Model into python script an it runs in Arc Python window.&lt;/P&gt;&lt;P&gt;I have created also a script that calls the toolbox and model inside and it works when run into Arc Python Window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I put it in Windows scheduler the task starts and completes but the table isn't updated meaning that the script doesn't run correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to run the same script in PyScripter and I get this error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Message&amp;nbsp;File Name&amp;nbsp;Line&amp;nbsp;Position&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Traceback&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module&amp;gt;&amp;nbsp;C:\Folder\script_startModel.py&amp;nbsp;15&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; TableReadings2&amp;nbsp;C:\Folder\Toolbox.tbx&amp;nbsp;75&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Input Table: Dataset database.sde.Building_Readings does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Failed to execute (ScriptReadings2).&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I tried to run the same script in Windows CMD and I get this error message:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;C:\Users\username&amp;gt;C:\python27\Arcgis10.5\python.exe C:\Folder\Script_startModel.py&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Traceback (most recent call last):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; File "C:\Folder\Script_startModel.py", line 15, in &amp;lt;module&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ModelReadings2_Toolbox()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; File "C:\Folder\Toolbox.tbx", line 75, in ModelReadings2&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Input Table: Dataset database_publish.sde.Building_Readings does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Failed to execute (ScriptReadings2).&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The main issue seems to be the database which is not recognised.&lt;/DIV&gt;&lt;DIV&gt;Any idea?&lt;/DIV&gt;&lt;DIV&gt;Thanks&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2019 10:47:18 GMT</pubDate>
    <dc:creator>PanGIS</dc:creator>
    <dc:date>2019-10-17T10:47:18Z</dc:date>
    <item>
      <title>Model / Script works in ArcMap but doesn't run when in Windows Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/model-script-works-in-arcmap-but-doesn-t-run-when/m-p/201580#M15506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I' ve created a model that updates a table in PostgreSQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The model runs perfectly as model and as tool as well.&lt;/P&gt;&lt;P&gt;Exported the Model into python script an it runs in Arc Python window.&lt;/P&gt;&lt;P&gt;I have created also a script that calls the toolbox and model inside and it works when run into Arc Python Window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I put it in Windows scheduler the task starts and completes but the table isn't updated meaning that the script doesn't run correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to run the same script in PyScripter and I get this error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Message&amp;nbsp;File Name&amp;nbsp;Line&amp;nbsp;Position&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Traceback&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module&amp;gt;&amp;nbsp;C:\Folder\script_startModel.py&amp;nbsp;15&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; TableReadings2&amp;nbsp;C:\Folder\Toolbox.tbx&amp;nbsp;75&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Input Table: Dataset database.sde.Building_Readings does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000989: Tool CalculateField cannot use VB expressions for services&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Failed to execute (ScriptReadings2).&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I tried to run the same script in Windows CMD and I get this error message:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;C:\Users\username&amp;gt;C:\python27\Arcgis10.5\python.exe C:\Folder\Script_startModel.py&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Traceback (most recent call last):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; File "C:\Folder\Script_startModel.py", line 15, in &amp;lt;module&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ModelReadings2_Toolbox()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; File "C:\Folder\Toolbox.tbx", line 75, in ModelReadings2&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The value does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Input Table: Dataset database_publish.sde.Building_Readings does not exist or is not supported&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Failed to execute (ScriptReadings2).&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The main issue seems to be the database which is not recognised.&lt;/DIV&gt;&lt;DIV&gt;Any idea?&lt;/DIV&gt;&lt;DIV&gt;Thanks&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 10:47:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-script-works-in-arcmap-but-doesn-t-run-when/m-p/201580#M15506</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2019-10-17T10:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Model / Script works in ArcMap but doesn't run when in Windows Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/model-script-works-in-arcmap-but-doesn-t-run-when/m-p/201581#M15507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've ran into this and for me I have to put the full path of the database\featuredataset\featureclass. It might be helpful if you posted your python code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Users\***\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\***_***_***.sde\yourfeaturedataset\featureclass&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 18:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-script-works-in-arcmap-but-doesn-t-run-when/m-p/201581#M15507</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2019-10-18T18:59:54Z</dc:date>
    </item>
  </channel>
</rss>

