<?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: 'GPEnvironment' object has no attribute 'extent' in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1138779#M63617</link>
    <description>&lt;P&gt;Kinda same happened to me. When I upgraded from v2.8 to v2.9 my script to create a multibuffer started giving an error&amp;nbsp;&lt;SPAN&gt;"AttributeError: 'GPEnvironment' object has no attribute 'overwrite'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I modified my script from this&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Allow overwriting&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy.env.workspace=arcpyenv&lt;BR /&gt;arcpy.env.overwrite=True&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#Allow overwriting&lt;BR /&gt;arcpy.env.workspace=arcpyenv&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;And it worked. Would be keen to know in-depth why is this the case though.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 02:22:59 GMT</pubDate>
    <dc:creator>Sahaja</dc:creator>
    <dc:date>2022-01-31T02:22:59Z</dc:date>
    <item>
      <title>'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132068#M63460</link>
      <description>&lt;P&gt;I am running a script on 2 different machines, both using the same ArcGIS Pro license. Machine #1 is using ArcGIS Pro v2.7.3, while machine #2 is using ArcGIS Pro v2.9.0.&lt;/P&gt;&lt;P&gt;The script works just fine in v2.7.3, but in v2.9.0, it throws the error: 'GPEnvironment' object has no attribute 'extent'.&lt;/P&gt;&lt;P&gt;There are several places in the script where I'm specifying environment settings, and it throws this GPEnvironment error at each. What could I be missing here?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:29:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132068#M63460</guid>
      <dc:creator>GB_MattPanunto_GISS</dc:creator>
      <dc:date>2022-01-10T16:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132074#M63461</link>
      <description>&lt;P&gt;You could view all the attributes in the debugger by setting a breakpoint and look at what's there with:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;stuff = arcpy.env&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if 'extent' is really there on the machine that is complaining. It is there in my 2.9.&amp;nbsp; Unless anyone else has any tips or knows where to set a setting for it... maybe needs to be reinstalled on that machine?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132074#M63461</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-01-10T16:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132077#M63462</link>
      <description>&lt;P&gt;Do you know where in your script it is called?&amp;nbsp; I can only find reference to&amp;nbsp;&lt;/P&gt;&lt;P&gt;GPEnvironment when referencing overwriteoutput in Production Mapping&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:48:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132077#M63462</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-10T16:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132117#M63463</link>
      <description>&lt;P&gt;I maybe should have mentioned in my initial post, but this error only happens during the multiprocessing portion of the script. I didn't think that was an important distinction, but clearly seems to be.&lt;/P&gt;&lt;P&gt;With that,&amp;nbsp;I think I may have stumbled upon something. Looking at the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm" target="_self"&gt;What's new in ArcGIS Pro 2.9&lt;/A&gt; list, it seems this type of error is a new implementation:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GB_MattPanunto_GISS_0-1641836229383.png" style="width: 553px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31117i0CAA8EB96F06656C/image-dimensions/553x112?v=v2" width="553" height="112" role="button" title="GB_MattPanunto_GISS_0-1641836229383.png" alt="GB_MattPanunto_GISS_0-1641836229383.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I tested this out by printing a arcpy.ListEnvironments() during the multiprocessor portion for both the v2.7.3 and v2.9.0 machines, and got the same result, shown here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GB_MattPanunto_GISS_1-1641836555862.png" style="width: 753px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31118i79D8F2DBB76FDE83/image-dimensions/753x389?v=v2" width="753" height="389" role="button" title="GB_MattPanunto_GISS_1-1641836555862.png" alt="GB_MattPanunto_GISS_1-1641836555862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It seems that most of the environment settings are missing from the multiprocessing environment. Why might that be? This suggests that they were never being set at all on the v2.7.3 machine, as that version wasn't capable of throwing errors for invalid environment names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 17:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1132117#M63463</guid>
      <dc:creator>GB_MattPanunto_GISS</dc:creator>
      <dc:date>2022-01-10T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1138779#M63617</link>
      <description>&lt;P&gt;Kinda same happened to me. When I upgraded from v2.8 to v2.9 my script to create a multibuffer started giving an error&amp;nbsp;&lt;SPAN&gt;"AttributeError: 'GPEnvironment' object has no attribute 'overwrite'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I modified my script from this&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Allow overwriting&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy.env.workspace=arcpyenv&lt;BR /&gt;arcpy.env.overwrite=True&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#Allow overwriting&lt;BR /&gt;arcpy.env.workspace=arcpyenv&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;And it worked. Would be keen to know in-depth why is this the case though.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 02:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1138779#M63617</guid>
      <dc:creator>Sahaja</dc:creator>
      <dc:date>2022-01-31T02:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1138807#M63618</link>
      <description>&lt;P&gt;Somebody changed the game rules and didn't dare to tell us. I'm sure somebody from ESRI will jump in and explain&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 08:39:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1138807#M63618</guid>
      <dc:creator>MarceloRosensaft</dc:creator>
      <dc:date>2022-01-31T08:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1242665#M66315</link>
      <description>&lt;P&gt;My script worked in ArcGIS Pro 2.7.3. After upgraded to Pro 2.8.5, got AttributeError: "GPEnvironment' object has no attribute 'Workspace'.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Rose&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 14:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1242665#M66315</guid>
      <dc:creator>RoseZhou2</dc:creator>
      <dc:date>2022-12-20T14:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1242668#M66316</link>
      <description>&lt;P&gt;Got it. It should be lower case "workspace".&lt;/P&gt;&lt;P&gt;Rose&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 14:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1242668#M66316</guid>
      <dc:creator>RoseZhou2</dc:creator>
      <dc:date>2022-12-20T14:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: 'GPEnvironment' object has no attribute 'extent'</title>
      <link>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1310191#M68214</link>
      <description>&lt;P&gt;Did you ever find a solution to this? When I print the current environment attributes, I get a pretty small subset *when running a static sub-class within a Script in an ArcPro Toolbox.*&lt;/P&gt;&lt;PRE&gt;['scratchGDB', 'scratchFolder', 'packageWorkspace', 'scriptWorkspace', 'addOutputsToMap', 'buildStatsAndRATForTempRaster', 'autoCancelling', 'isCancelled', 'overwriteOutput']&lt;/PRE&gt;&lt;P&gt;I am not sure what limits the environments available as a result of it being called within a Toolbox, as opposed to being called from a 'regular' Python script.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError: 'GPEnvironment' object has no attribute 'XYResolution'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 19:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpenvironment-object-has-no-attribute-extent/m-p/1310191#M68214</guid>
      <dc:creator>KevinGabelman</dc:creator>
      <dc:date>2023-07-20T19:20:30Z</dc:date>
    </item>
  </channel>
</rss>

