<?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: Esri Advanced Guide to Python in ArcGis Tutorial 4-1 creating a &amp;quot;FileExistsError&amp;quot; in Esri Press Books Questions</title>
    <link>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1674999#M744</link>
    <description>&lt;P&gt;I haven't been able to reproduce this on my end using Windows 11 and the Python environment that comes with ArcGIS Pro 3.6.0.&amp;nbsp; I know when we wrote the book and tested it, we were working on Windows 10 with ArcGIS Pro 3.4.x.&lt;/P&gt;&lt;P&gt;Maybe consider printing/returning&lt;STRONG&gt; fgdb_folder_name&lt;/STRONG&gt; and &lt;STRONG&gt;fgdb_folder_location.&lt;/STRONG&gt; There may be something going on with your relative pathing depending on where it is on your machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Dec 2025 16:14:15 GMT</pubDate>
    <dc:creator>Esri_Dave_Crawford</dc:creator>
    <dc:date>2025-12-26T16:14:15Z</dc:date>
    <item>
      <title>Esri Advanced Guide to Python in ArcGis Tutorial 4-1 creating a "FileExistsError"</title>
      <link>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1668750#M739</link>
      <description>&lt;P&gt;I have a question about the following script in Tutorial 4-1 of the Esri Advanced Guide to Python book:&amp;nbsp;when I run it, it produces a "FileExistsError"; the script is in fact creating a new folder and a duplicate .gdb file, but I don't know why. Below is the portion in question with the subsequent error message. Thanks!&lt;/P&gt;&lt;P&gt;source_fgdb_path = Path(r".\Parking_Violations_and_Neighborhoods.gdb")&lt;/P&gt;&lt;P&gt;arcpy.management.Compact(str(source_fgdb_path))&lt;/P&gt;&lt;P&gt;# The name of the folder to place the file geodatabase in&lt;BR /&gt;fgdb_folder_name = source_fgdb_path.stem&lt;BR /&gt;# The location of the folder to place the file geodatabase in&lt;BR /&gt;fgdb_folder_location = source_fgdb_path.parent&lt;BR /&gt;# The path to the folder to place the file geodatabase in&lt;BR /&gt;fgdb_folder_path = fgdb_folder_location.joinpath(fgdb_folder_name)&lt;BR /&gt;# The path of our copied file geodatabase&lt;BR /&gt;fgdb_path = fgdb_folder_path.joinpath(source_fgdb_path.name)&lt;/P&gt;&lt;P&gt;# Copy the file geodatabase to the new location&lt;BR /&gt;shutil.copytree(source_fgdb_path, fgdb_path)&lt;BR /&gt;# Zip the file geodatabase&lt;BR /&gt;zipped_fgdb = shutil.make_archive(&lt;BR /&gt;base_name=fgdb_folder_path,&lt;BR /&gt;# The name of the archive, not including the file extension&lt;BR /&gt;format="zip", # The archive format&lt;BR /&gt;root_dir=fgdb_folder_path, # The directory to archive&lt;BR /&gt;)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;FileExistsError&lt;/SPAN&gt;                           Traceback (most recent call last)
Cell &lt;SPAN class=""&gt;In[7], line 2&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      1&lt;/SPAN&gt; &lt;SPAN&gt;# Copy the file geodatabase to the new location&lt;/SPAN&gt;
&lt;SPAN class=""&gt;----&amp;gt; 2&lt;/SPAN&gt; shutil&lt;SPAN&gt;.&lt;/SPAN&gt;copytree(source_fgdb_path, fgdb_path)
&lt;SPAN class=""&gt;      3&lt;/SPAN&gt; &lt;SPAN&gt;# Zip the file geodatabase&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      4&lt;/SPAN&gt; zipped_fgdb &lt;SPAN&gt;=&lt;/SPAN&gt; shutil&lt;SPAN&gt;.&lt;/SPAN&gt;make_archive(
&lt;SPAN class=""&gt;      5&lt;/SPAN&gt;     base_name&lt;SPAN&gt;=&lt;/SPAN&gt;fgdb_folder_path,
&lt;SPAN class=""&gt;      6&lt;/SPAN&gt;     &lt;SPAN&gt;# The name of the archive, not including the file extension&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      7&lt;/SPAN&gt;     &lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;zip&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;, &lt;SPAN&gt;# The archive format&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      8&lt;/SPAN&gt;     root_dir&lt;SPAN&gt;=&lt;/SPAN&gt;fgdb_folder_path, &lt;SPAN&gt;# The directory to archive&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      9&lt;/SPAN&gt; )

File &lt;SPAN class=""&gt;~\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\shutil.py:573&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;copytree&lt;/SPAN&gt;&lt;SPAN class=""&gt;(src, dst, symlinks, ignore, copy_function, ignore_dangling_symlinks, dirs_exist_ok)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;    571&lt;/SPAN&gt; &lt;SPAN class=""&gt;with&lt;/SPAN&gt; os&lt;SPAN&gt;.&lt;/SPAN&gt;scandir(src) &lt;SPAN class=""&gt;as&lt;/SPAN&gt; itr:
&lt;SPAN class=""&gt;    572&lt;/SPAN&gt;     entries &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;list&lt;/SPAN&gt;(itr)
&lt;SPAN class=""&gt;--&amp;gt; 573&lt;/SPAN&gt; &lt;SPAN class=""&gt;return&lt;/SPAN&gt; _copytree(entries&lt;SPAN&gt;=&lt;/SPAN&gt;entries, src&lt;SPAN&gt;=&lt;/SPAN&gt;src, dst&lt;SPAN&gt;=&lt;/SPAN&gt;dst, symlinks&lt;SPAN&gt;=&lt;/SPAN&gt;symlinks,
&lt;SPAN class=""&gt;    574&lt;/SPAN&gt;                  ignore&lt;SPAN&gt;=&lt;/SPAN&gt;ignore, copy_function&lt;SPAN&gt;=&lt;/SPAN&gt;copy_function,
&lt;SPAN class=""&gt;    575&lt;/SPAN&gt;                  ignore_dangling_symlinks&lt;SPAN&gt;=&lt;/SPAN&gt;ignore_dangling_symlinks,
&lt;SPAN class=""&gt;    576&lt;/SPAN&gt;                  dirs_exist_ok&lt;SPAN&gt;=&lt;/SPAN&gt;dirs_exist_ok)

File &lt;A target="_blank"&gt;&lt;SPAN class=""&gt;~\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\shutil.py:471&lt;/SPAN&gt;&lt;/A&gt;, in &lt;SPAN class=""&gt;_copytree&lt;/SPAN&gt;&lt;SPAN class=""&gt;(entries, src, dst, symlinks, ignore, copy_function, ignore_dangling_symlinks, dirs_exist_ok)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;    468&lt;/SPAN&gt; &lt;SPAN class=""&gt;else&lt;/SPAN&gt;:
&lt;SPAN class=""&gt;    469&lt;/SPAN&gt;     ignored_names &lt;SPAN&gt;=&lt;/SPAN&gt; ()
&lt;SPAN class=""&gt;--&amp;gt; 471&lt;/SPAN&gt; os&lt;SPAN&gt;.&lt;/SPAN&gt;makedirs(dst, exist_ok&lt;SPAN&gt;=&lt;/SPAN&gt;dirs_exist_ok)
&lt;SPAN class=""&gt;    472&lt;/SPAN&gt; errors &lt;SPAN&gt;=&lt;/SPAN&gt; []
&lt;SPAN class=""&gt;    473&lt;/SPAN&gt; use_srcentry &lt;SPAN&gt;=&lt;/SPAN&gt; copy_function &lt;SPAN class=""&gt;is&lt;/SPAN&gt; copy2 &lt;SPAN class=""&gt;or&lt;/SPAN&gt; copy_function &lt;SPAN class=""&gt;is&lt;/SPAN&gt; copy

File &lt;SPAN class=""&gt;&amp;lt;frozen os&amp;gt;:225&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;makedirs&lt;/SPAN&gt;&lt;SPAN class=""&gt;(name, mode, exist_ok)&lt;/SPAN&gt;

&lt;SPAN class=""&gt;FileExistsError&lt;/SPAN&gt;: [WinError 183] &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 13:05:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1668750#M739</guid>
      <dc:creator>MeenakshiSundaresan</dc:creator>
      <dc:date>2025-11-26T13:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Esri Advanced Guide to Python in ArcGis Tutorial 4-1 creating a "FileExistsError"</title>
      <link>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1671252#M740</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/955247"&gt;@MeenakshiSundaresan&lt;/a&gt;&amp;nbsp; What version of ArcGIS Pro are you running?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 15:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1671252#M740</guid>
      <dc:creator>Esri_Dave_Crawford</dc:creator>
      <dc:date>2025-12-08T15:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Esri Advanced Guide to Python in ArcGis Tutorial 4-1 creating a "FileExistsError"</title>
      <link>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1673848#M743</link>
      <description>&lt;P&gt;Thanks for your response Dave. I'm running 3.5.4, but when I got the error, it was in Jupyter.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 02:33:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1673848#M743</guid>
      <dc:creator>MeenakshiSundaresan</dc:creator>
      <dc:date>2025-12-18T02:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Esri Advanced Guide to Python in ArcGis Tutorial 4-1 creating a "FileExistsError"</title>
      <link>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1674999#M744</link>
      <description>&lt;P&gt;I haven't been able to reproduce this on my end using Windows 11 and the Python environment that comes with ArcGIS Pro 3.6.0.&amp;nbsp; I know when we wrote the book and tested it, we were working on Windows 10 with ArcGIS Pro 3.4.x.&lt;/P&gt;&lt;P&gt;Maybe consider printing/returning&lt;STRONG&gt; fgdb_folder_name&lt;/STRONG&gt; and &lt;STRONG&gt;fgdb_folder_location.&lt;/STRONG&gt; There may be something going on with your relative pathing depending on where it is on your machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Dec 2025 16:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-press-books-questions/esri-advanced-guide-to-python-in-arcgis-tutorial-4/m-p/1674999#M744</guid>
      <dc:creator>Esri_Dave_Crawford</dc:creator>
      <dc:date>2025-12-26T16:14:15Z</dc:date>
    </item>
  </channel>
</rss>

