<?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 arcpy.Exists Error after ArcGIS Pro 2.6 to 2.8.2 upgrade in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096818#M62312</link>
    <description>&lt;P&gt;I have a REST maintenance script that I inherited that was written for ArcGIS Pro 2.6.&amp;nbsp; It checks to see if the AGS connection is valid.&lt;/P&gt;&lt;P&gt;### ArcServer Connection ###&lt;BR /&gt;arcserver_ags_file = r"D:\_AGS_Connection\giswebsite@ArcServer@GIS_Admin.ags"&lt;/P&gt;&lt;P&gt;#### ArcServer Check ###&lt;BR /&gt;if arcpy.Exists(arcserver_ags_file) == True:&lt;BR /&gt;print("The following arcserver_ags_file will be used: " + str(arcserver_ags_file))&lt;BR /&gt;if arcpy.Exists(arcserver_ags_file) == False:&lt;BR /&gt;print("Stopping the script because your arcserver_ags_file is not set or does not exist.")&lt;BR /&gt;exit()&lt;/P&gt;&lt;P&gt;Since the upgrade from Pro 2.6 to 2.8.2, the script ends because it doesn't recognize the AGS file.&amp;nbsp; The user has full access to the file location and verified that the AGS connection is accessible and able to connect to it.&lt;/P&gt;&lt;P&gt;I'm a beginner at python that can interpret/understand code but by no means considered a developer.&amp;nbsp; Any assistance in getting this solved is much appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 16:06:57 GMT</pubDate>
    <dc:creator>Min-DongChang</dc:creator>
    <dc:date>2021-09-09T16:06:57Z</dc:date>
    <item>
      <title>arcpy.Exists Error after ArcGIS Pro 2.6 to 2.8.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096818#M62312</link>
      <description>&lt;P&gt;I have a REST maintenance script that I inherited that was written for ArcGIS Pro 2.6.&amp;nbsp; It checks to see if the AGS connection is valid.&lt;/P&gt;&lt;P&gt;### ArcServer Connection ###&lt;BR /&gt;arcserver_ags_file = r"D:\_AGS_Connection\giswebsite@ArcServer@GIS_Admin.ags"&lt;/P&gt;&lt;P&gt;#### ArcServer Check ###&lt;BR /&gt;if arcpy.Exists(arcserver_ags_file) == True:&lt;BR /&gt;print("The following arcserver_ags_file will be used: " + str(arcserver_ags_file))&lt;BR /&gt;if arcpy.Exists(arcserver_ags_file) == False:&lt;BR /&gt;print("Stopping the script because your arcserver_ags_file is not set or does not exist.")&lt;BR /&gt;exit()&lt;/P&gt;&lt;P&gt;Since the upgrade from Pro 2.6 to 2.8.2, the script ends because it doesn't recognize the AGS file.&amp;nbsp; The user has full access to the file location and verified that the AGS connection is accessible and able to connect to it.&lt;/P&gt;&lt;P&gt;I'm a beginner at python that can interpret/understand code but by no means considered a developer.&amp;nbsp; Any assistance in getting this solved is much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 16:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096818#M62312</guid>
      <dc:creator>Min-DongChang</dc:creator>
      <dc:date>2021-09-09T16:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists Error after ArcGIS Pro 2.6 to 2.8.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096830#M62314</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14664"&gt;@Min-DongChang&lt;/a&gt;&amp;nbsp;I was able to reproduce this, so I believe this is a bug.&amp;nbsp; To workaround this issue, you could use &lt;STRONG&gt;os.path.isfile&lt;/STRONG&gt; in place of &lt;STRONG&gt;arcpy.Exists&lt;/STRONG&gt;.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, os
arcserver_ags_file = r"D:\_AGS_Connection\giswebsite@ArcServer@GIS_Admin.ags"

#### ArcServer Check ###
if os.path.isfile(arcserver_ags_file) == True:
    print("The following arcserver_ags_file will be used: " + str(arcserver_ags_file))
if os.path.isfile(arcserver_ags_file) == False:
    print("Stopping the script because your arcserver_ags_file is not set or does not exist.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 16:20:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096830#M62314</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-09-09T16:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists Error after ArcGIS Pro 2.6 to 2.8.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096834#M62315</link>
      <description>&lt;P&gt;Thank you Jake!&amp;nbsp; Worked like a charm.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 16:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-error-after-arcgis-pro-2-6-to-2-8-2/m-p/1096834#M62315</guid>
      <dc:creator>Min-DongChang</dc:creator>
      <dc:date>2021-09-09T16:32:18Z</dc:date>
    </item>
  </channel>
</rss>

