<?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 Running standalone python 3 script in scheduled task on ArcGIS Server in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/running-standalone-python-3-script-in-scheduled/m-p/1079179#M61773</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to run standalone python 3 scripts (using arcpy) in scheduled tasks on arcgis server v10.6.1 on Windows Server 2019.&lt;/P&gt;&lt;P&gt;I have found an installation of python 3 in this location:&amp;nbsp;&lt;STRONG&gt;C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\&lt;/STRONG&gt; and I wonder if it's ok to use it for running standalone scripts because ArcGIS Pro is not installed on that server, there is only ArcGIS Server.&lt;/P&gt;&lt;P&gt;Also, I have read that I have to create a new python env in order to keep the&amp;nbsp;&lt;STRONG&gt;arcgispro-py3&lt;/STRONG&gt; intact. Is it ok to create a new python env in the&amp;nbsp;&lt;STRONG&gt;C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs&lt;/STRONG&gt; ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any suggestions in regard with what I am trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Maxime&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 14:58:15 GMT</pubDate>
    <dc:creator>MaximeDemers</dc:creator>
    <dc:date>2021-07-15T14:58:15Z</dc:date>
    <item>
      <title>Running standalone python 3 script in scheduled task on ArcGIS Server</title>
      <link>https://community.esri.com/t5/python-questions/running-standalone-python-3-script-in-scheduled/m-p/1079179#M61773</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to run standalone python 3 scripts (using arcpy) in scheduled tasks on arcgis server v10.6.1 on Windows Server 2019.&lt;/P&gt;&lt;P&gt;I have found an installation of python 3 in this location:&amp;nbsp;&lt;STRONG&gt;C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\&lt;/STRONG&gt; and I wonder if it's ok to use it for running standalone scripts because ArcGIS Pro is not installed on that server, there is only ArcGIS Server.&lt;/P&gt;&lt;P&gt;Also, I have read that I have to create a new python env in order to keep the&amp;nbsp;&lt;STRONG&gt;arcgispro-py3&lt;/STRONG&gt; intact. Is it ok to create a new python env in the&amp;nbsp;&lt;STRONG&gt;C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs&lt;/STRONG&gt; ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any suggestions in regard with what I am trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Maxime&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 14:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-standalone-python-3-script-in-scheduled/m-p/1079179#M61773</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-07-15T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Running standalone python 3 script in scheduled task on ArcGIS Server</title>
      <link>https://community.esri.com/t5/python-questions/running-standalone-python-3-script-in-scheduled/m-p/1079284#M61777</link>
      <description>&lt;P&gt;You might need administrator rights to create an environment in Program Files but it really should not matter where it is as long the user running the scheduled task has permission to read the folder.&lt;/P&gt;&lt;P&gt;I do "conda env list" to see all the environments set up on a machine and I see this&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# conda environments:
#
arcgispro-py3   * C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
arctic            C:\Users\bwilson\AppData\Local\ESRI\conda\envs\arctic
covid             C:\Users\bwilson\AppData\Local\ESRI\conda\envs\covid
dembuilder        C:\Users\bwilson\AppData\Local\ESRI\conda\envs\dembuilder
p39               C:\Users\bwilson\AppData\Local\ESRI\conda\envs\p39&lt;/LI-CODE&gt;&lt;P&gt;Then I can use the full path to python in a script by picking any of those and adding "\python.exe" to the end for example&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;C:\Users\bwilson\AppData\Local\ESRI\conda\envs\arctic\python.exe --version&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Python 3.7.9&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Personally I avoid using "Program Files" because the space is endless pain in scripts.&lt;/P&gt;&lt;P&gt;You might need to set up your environment PATH variable to let you use conda.&amp;nbsp; It is in C:\Program Files\ArcGIS\Pro\bin\Python\Scripts&lt;/P&gt;&lt;P&gt;Another useful command once you have conda working at command line is "conda info", it will list all the env directories it knows about. (and lots of other stuff)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-standalone-python-3-script-in-scheduled/m-p/1079284#M61777</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2021-07-15T16:10:17Z</dc:date>
    </item>
  </channel>
</rss>

