<?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: ArcGIS Project (.aprx) lock not released in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687172#M30382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running the script from ArcGIS Pro (Script tool in Toolbox), so there is no python window or ide to close.&lt;/P&gt;&lt;P&gt;Indeed, I tried to delete those variables as well.&lt;/P&gt;&lt;P&gt;The documentation clearly states that the object still has the reference to the former aprx file:&lt;BR /&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The method creates a new output project file, but the project variable continues to reference the original &lt;SPAN class=""&gt;ArcGISProject&lt;/SPAN&gt; object. It does not duplicate all the content within a project folder.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I reckon it is a bug in arcpy....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2018 06:09:08 GMT</pubDate>
    <dc:creator>nita14</dc:creator>
    <dc:date>2018-09-20T06:09:08Z</dc:date>
    <item>
      <title>ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687170#M30380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;It seems that arcpy.mp does not release the lock of the resulting (new) aprx document. The following code does create a new aprx file:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;aprx_project.saveACopy(os.path.join(workspace, prefix, name_to_save))
del aprx_project&lt;/PRE&gt;&lt;P&gt;Unfortunately, the lock persists on the new .aprx file. Is there any way to remove it? Only after I close the ArcGIS Pro which I use to run the script, the lock is released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hints are much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ArcGIS Pro v.2.2.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687170#M30380</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2021-12-12T04:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687171#M30381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# ---- try the hardway&lt;/SPAN&gt;
aprx_project&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;saveACopy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; prefix&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; name_to_save&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
prefix &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
name_to_save &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; prefix
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; workspace
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; name_to_save
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx_project

&lt;SPAN class="comment token"&gt;#---- still may fail to release the lock&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#----&amp;nbsp; close your ide&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;are you running this in the internal python ide or an external one?&lt;/P&gt;&lt;P&gt;I suppose you have tried deleting the workspace, prefix and name_to_save prior to deleting the project variable as well.&lt;/P&gt;&lt;P&gt;finally, try closing the python window.&amp;nbsp; 'del' removes the variable from the namespace only, locks can be&amp;nbsp; different beast&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687171#M30381</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T04:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687172#M30382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running the script from ArcGIS Pro (Script tool in Toolbox), so there is no python window or ide to close.&lt;/P&gt;&lt;P&gt;Indeed, I tried to delete those variables as well.&lt;/P&gt;&lt;P&gt;The documentation clearly states that the object still has the reference to the former aprx file:&lt;BR /&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The method creates a new output project file, but the project variable continues to reference the original &lt;SPAN class=""&gt;ArcGISProject&lt;/SPAN&gt; object. It does not duplicate all the content within a project folder.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I reckon it is a bug in arcpy....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 06:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687172#M30382</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2018-09-20T06:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687173#M30383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you run it from the tool in arctoolbox and it completes, do you notice an orange exclamation mark beside the output filename, with a warning that the output filename already exists?&amp;nbsp; If so, this would mean that references to the output filename persist.&amp;nbsp; If not, then the deletion of the output filename is no longer in memory..&amp;nbsp; Worth a check&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 09:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687173#M30383</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-20T09:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687174#M30384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No warnings at all in the tool output window...&lt;/P&gt;&lt;P&gt;It seems that I need to get use to that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 11:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687174#M30384</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2018-09-20T11:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687175#M30385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what you get, until the tool is closed,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="381" src="https://community.esri.com/legacyfs/online/422523_already_exists.png" width="789" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 12:34:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687175#M30385</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-20T12:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687176#M30386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name is unique. No warnings at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 12:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/687176#M30386</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2018-09-20T12:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1046706#M39689</link>
      <description>&lt;P&gt;I've run into the same problem - very simple scenario and there seems to be nothing I can do in my python script to delete the aprx file that I've finished with.&amp;nbsp; Restarting the python process gets rid of the file but that isn't really an option in my workflow.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 00:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1046706#M39689</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2021-04-14T00:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1209137#M59451</link>
      <description>&lt;P&gt;I have a script that copies an aprx file to a temporary directory. The script does it's thing but needs to remove the temporary directory when it's done working. I couldn't remove the temp directory b/c of the aprx lock.&lt;/P&gt;&lt;P&gt;I was able to get around it by using the built-in python module atexit. atexit allows you to register a function to run at the end of a script... this may not help you if you're running code from an interactive window. However, for a standalone script this worked for me.&amp;nbsp; &lt;A href="https://docs.python.org/3.7/library/atexit.html" target="_blank"&gt;https://docs.python.org/3.7/library/atexit.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def goodbye(name, adjective):
    print('Goodbye %s, it was %s to meet you.' % (name, adjective))

import atexit

atexit.register(goodbye, 'Donny', 'nice')
# or:
atexit.register(goodbye, adjective='nice', name='Donny')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 14:04:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1209137#M59451</guid>
      <dc:creator>DallasShearer225</dc:creator>
      <dc:date>2022-09-02T14:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1380904#M78621</link>
      <description>&lt;P&gt;It'd be great if this could be resolved. Running into the same problem in Pro v3.2.1.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 07:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1380904#M78621</guid>
      <dc:creator>MatthewGeorge</dc:creator>
      <dc:date>2024-02-12T07:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1407024#M81565</link>
      <description>&lt;P&gt;Same problem here V 3.2.2&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 06:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1407024#M81565</guid>
      <dc:creator>YousifAlmamalachy</dc:creator>
      <dc:date>2024-04-08T06:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Project (.aprx) lock not released</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1517940#M86741</link>
      <description>&lt;P&gt;I am having this same issue using&amp;nbsp;arcpy.mp.ArcGISProject and the pro project gets locked into Read-Only mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;prj = arcpy.mp.ArcGISProject(prjPath)&lt;/P&gt;&lt;P&gt;del prj&lt;/P&gt;&lt;P&gt;del prj doesn't work to unlock the project. Any suggestions on how to get the script to unlock the project?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2024 22:19:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-project-aprx-lock-not-released/m-p/1517940#M86741</guid>
      <dc:creator>MeghanBlair</dc:creator>
      <dc:date>2024-08-10T22:19:00Z</dc:date>
    </item>
  </channel>
</rss>

