<?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 Re: arcpy.Exists fails in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591331#M46360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 16:35:12 GMT</pubDate>
    <dc:creator>KennethKirkeby</dc:creator>
    <dc:date>2016-01-29T16:35:12Z</dc:date>
    <item>
      <title>arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591327#M46356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ArcGIS 10.3.1; Python 2.7.11&lt;/P&gt;&lt;P&gt;The file &lt;STRONG&gt;DOES&lt;/STRONG&gt; exist but reporting that it does not. The syntax looks correct to my newbie eyes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************************************************************************************&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "C:\\Users\\kkirkeby\\Desktop\\GIS-4080\\Lesson4_Data\\Lesson4_Data"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Variables&lt;/P&gt;&lt;P&gt;out_folder_path = 'C:\\Users\\kkirkeby\\Desktop\\GIS-4080\\Lesson4_Data\\Lesson4_Data'&lt;/P&gt;&lt;P&gt;gdb_name = 'L4E5'&lt;/P&gt;&lt;P&gt;gdb_fullPath = out_folder_path +'/' + gdb_name&lt;/P&gt;&lt;P&gt;fclist = arcpy.ListFeatureClasses()&lt;/P&gt;&lt;P&gt;fcIn = 0&lt;/P&gt;&lt;P&gt;fcOut = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create gdb if it doesn't exist.&lt;/P&gt;&lt;P&gt;if arcpy.Exists(gdb_fullPath):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Geodatabase already exist"&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Geodatabase does not exist. Creating..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.Exists(gdb_fullPath)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print gdb_fullPath&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFileGDB_management(out_folder_path, gdb_name)&lt;/P&gt;&lt;P&gt;******************************************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;================================ RESTART ================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Geodatabase does not exist. Creating...&lt;/P&gt;&lt;P&gt;False&lt;/P&gt;&lt;P&gt;C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data/L4E5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 15:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591327#M46356</guid>
      <dc:creator>KennethKirkeby</dc:creator>
      <dc:date>2016-01-29T15:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591328#M46357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you try concatenating your file with "\\" instead of "/" the inconsistency in the final version may be confusing&lt;/P&gt;&lt;P&gt;not specific to gdb's but&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/55463" target="_blank"&gt;Filenames and file paths in Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; f = "file"
&amp;gt;&amp;gt;&amp;gt; path = r"c:\temp\text.gdb"
&amp;gt;&amp;gt;&amp;gt; full = path+ "\" + f
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; full = path+ "\" + f
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^
SyntaxError: EOL while scanning string literal
&amp;gt;&amp;gt;&amp;gt; full = path+ "\\" + f
&amp;gt;&amp;gt;&amp;gt; full
'c:\\temp\\text.gdb\\file'

&amp;gt;&amp;gt;&amp;gt; full
'c:\\temp\\text.gdb/file'
# works but may be confusing&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:24:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591328#M46357</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T01:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591329#M46358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;gdb_name = 'L4E5.gdb'
gdb_fullPath = out_folder_path +'\' + gdb_name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I typically would construct strings a bit differently using the 'r' literal:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;out_folder_path = r'C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data'
gdb_name = 'L4E5.gdb'
gdb_fullPath = out_folder_path +'\' + gdb_name&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:24:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591329#M46358</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T01:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591330#M46359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also change &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;gdb_fullPath = out_folder_path +&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;'\\'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; + gdb_name &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print out_folder_path = C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data&lt;/P&gt;&lt;P&gt;print gdb_name = l4_ex5&lt;/P&gt;&lt;P&gt;print gdb_fullPath = C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data\l4_ex5&lt;/P&gt;&lt;P&gt;print arcpy.Exists(gdb_fullPath) = False&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:34:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591330#M46359</guid>
      <dc:creator>KennethKirkeby</dc:creator>
      <dc:date>2016-01-29T16:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591331#M46360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:35:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591331#M46360</guid>
      <dc:creator>KennethKirkeby</dc:creator>
      <dc:date>2016-01-29T16:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591332#M46361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14540855889216694" data-renderedposition="50_8_912_16" jivemacro_uid="_14540855889216694"&gt;&lt;P&gt;C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data\l4_ex5&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is not a geodatabase/workspace.&amp;nbsp; You are missing the ".gdb" at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14540856095531265" data-renderedposition="129_8_912_16" jivemacro_uid="_14540856095531265"&gt;&lt;P&gt;C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data\l4_ex5&lt;STRONG&gt;.gdb&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591332#M46361</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-01-29T16:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591333#M46362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well there's 4 hours I'll never get back ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. Details, details, details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:43:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591333#M46362</guid>
      <dc:creator>KennethKirkeby</dc:creator>
      <dc:date>2016-01-29T16:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591334#M46363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will regain it in the future since you will not likely make that mistake again... Now if we could get people to quit using paths with spaces in them...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:48:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591334#M46363</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-29T16:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Exists fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591335#M46364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had read the link you listed before and thought I was good. I like your comment about using os.path instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 17:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exists-fails/m-p/591335#M46364</guid>
      <dc:creator>KennethKirkeby</dc:creator>
      <dc:date>2016-01-29T17:01:20Z</dc:date>
    </item>
  </channel>
</rss>

