<?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: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!! in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1218975#M7853</link>
    <description>&lt;P&gt;Had the same error message, it turned out admin module has more dependencies and some were missing (in my case pandas). Try putting:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis.gis.admin&lt;/LI-CODE&gt;&lt;P&gt;in standalone script, and see what happens (I got as below, and installing pandas solved the problem)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "C:\Miniconda3\lib\site-packages\arcgis\gis\admin\__init__.py", line 9, in &amp;lt;module&amp;gt;
    from .portaladmin import PortalAdminManager
  File "C:\Miniconda3\lib\site-packages\arcgis\gis\admin\portaladmin.py", line 10, in &amp;lt;module&amp;gt;
    from ...apps.tracker._location_tracking import LocationTrackingManager
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\__init__.py", line 4, in &amp;lt;module&amp;gt;
    from . import survey123
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\survey123\__init__.py", line 3, in &amp;lt;module&amp;gt;
    from ._survey import SurveyManager, Survey
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\survey123\_survey.py", line 10, in &amp;lt;module&amp;gt;
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2022 15:01:06 GMT</pubDate>
    <dc:creator>ArkadiuszMatoszka</dc:creator>
    <dc:date>2022-10-05T15:01:06Z</dc:date>
    <item>
      <title>AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216210#M7810</link>
      <description>&lt;P&gt;the following code produces the error: &lt;FONT color="#993300"&gt;&lt;STRONG&gt;AttributeError: 'GIS' object has no attribute 'admin'&lt;/STRONG&gt; &lt;/FONT&gt;&lt;U&gt;but only in a stand alone script executed from the command line&lt;/U&gt;. The identical code works fine in Jupyter lab as well as the Python window in Pro.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Trimmed down the code in case anyone wants to attempt to replicate on their end.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Import Modules
from arcgis.gis import GIS

##Log into Enterprise
gis1 = GIS("https://website.com/portal", username = "user@company.com", password = "password", verify_cert=False) 
print("Logged in as: " + gis1.properties.user.username)

#Create server object
gis_servers=gis1.admin.servers.list()
server1 = gis_servers[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fails at line 9.&lt;/P&gt;&lt;P&gt;The user is an administrator.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Additional Details:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Pro 3.0.2 using a cloned environment&lt;/LI&gt;&lt;LI&gt;ArcGIS API version 2.0.1&lt;/LI&gt;&lt;LI&gt;Behavior is the same whether I run via python.exe or propy.bat&lt;/LI&gt;&lt;LI&gt;I use stand alone scripts along with task scheduler all the time&lt;/LI&gt;&lt;LI&gt;Modifications to the OS System Environment Variables does not fix this&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRIKE&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Other Observations (potential red herring though):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt; This has all been ruled out as I can reproduce in multiple environments (completely different devices/workstations).&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRIKE&gt;setting the 'path' system variable to the current cloned environment location and then typing 'python' in PowerShell yields the following warning: &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyHart_0-1664217924116.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52220i4F920F2BAECFD318/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZacharyHart_0-1664217924116.png" alt="ZacharyHart_0-1664217924116.png" /&gt;&lt;/span&gt;&lt;/STRIKE&gt;&lt;P&gt;&lt;STRIKE&gt;but lists the correct version of the arcgis module. The same AttributeError is returned in this configuration.&lt;/STRIKE&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRIKE&gt;The same Attribute Error is returned if the path system variable is set to the default Python environment as well.&lt;/STRIKE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRIKE&gt;Switching the environments in ArcGIS Pro does not change the results.&lt;/STRIKE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRIKE&gt;using the ProPy.bat from PowerShell does launch a Python command line without the activation warning shown above.&lt;/STRIKE&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 28 Sep 2022 12:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216210#M7810</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-09-28T12:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216593#M7815</link>
      <description>&lt;P&gt;I trimmed down the code significantly should anyone want to try to reproduce.&lt;/P&gt;&lt;P&gt;I have also reproduced with with a built-in admin account as well as a domain user account with the Admin role in Enterprise. I have reproduced this from multiple environments.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 16:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216593#M7815</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-09-27T16:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216902#M7821</link>
      <description>&lt;P&gt;Another update: I modified the script to also include:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
print("arcgis API is version {0}".format(arcgis.__version__))&lt;/LI-CODE&gt;&lt;P&gt;So I can confirm that no matter how the script is called, the correct/latest version of the arcgis API is indeed being used.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 12:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216902#M7821</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-09-28T12:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216951#M7822</link>
      <description>&lt;P&gt;I get a different error myself, doesn't matter if I do stand alone with IDLE or notebook in Pro.&lt;/P&gt;&lt;P&gt;If I run it with Pro 2.9.3 with IDLE 3.7.11 (which reports "arcgis API is version 1.9.1") it says "'AGOLAdminManager' object has no attribute 'servers'"&lt;/P&gt;&lt;P&gt;If I run it with Pro 3.0.1, with IDLE 3.9.11 and reports "arcgis API is version 2.0.1" it runs fine and gives me a list of servers.&lt;/P&gt;&lt;P&gt;Default install environment, no clones.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 14:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216951#M7822</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-09-28T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216961#M7823</link>
      <description>&lt;P&gt;I should probably add a few points for clarity:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We have a federated ArcGIS Enterprise deployment&lt;/LI&gt;&lt;LI&gt;In my case, by stand-alone script I mean running from a command prompt/PowerShell session.&lt;UL&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/using-conda-with-arcgis-pro.htm" target="_self"&gt;Further described here&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;I have tried this with both base &amp;amp; cloned conda environments.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It's entirely possible the servers module was different at 1.9.1.&lt;/P&gt;&lt;P&gt;Could you try running from the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/using-conda-with-arcgis-pro.htm" target="_self"&gt;command line&lt;/A&gt; (referencing the most recent API)? That's the key difference here (as far as all my testing has shown).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 15:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1216961#M7823</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-09-28T15:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1218975#M7853</link>
      <description>&lt;P&gt;Had the same error message, it turned out admin module has more dependencies and some were missing (in my case pandas). Try putting:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis.gis.admin&lt;/LI-CODE&gt;&lt;P&gt;in standalone script, and see what happens (I got as below, and installing pandas solved the problem)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "C:\Miniconda3\lib\site-packages\arcgis\gis\admin\__init__.py", line 9, in &amp;lt;module&amp;gt;
    from .portaladmin import PortalAdminManager
  File "C:\Miniconda3\lib\site-packages\arcgis\gis\admin\portaladmin.py", line 10, in &amp;lt;module&amp;gt;
    from ...apps.tracker._location_tracking import LocationTrackingManager
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\__init__.py", line 4, in &amp;lt;module&amp;gt;
    from . import survey123
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\survey123\__init__.py", line 3, in &amp;lt;module&amp;gt;
    from ._survey import SurveyManager, Survey
  File "C:\Miniconda3\lib\site-packages\arcgis\apps\survey123\_survey.py", line 10, in &amp;lt;module&amp;gt;
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1218975#M7853</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2022-10-05T15:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1219633#M7869</link>
      <description>&lt;PRE&gt;import arcgis.gis.admin&lt;/PRE&gt;&lt;P&gt;I already had this in my script and It still tells me&lt;/P&gt;&lt;P&gt;AttributeError: 'GIS' object has no attribute 'admin'&lt;/P&gt;&lt;P&gt;Same issue as &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/194227"&gt;@ZacharyHart&lt;/a&gt; here. Federated server, SAML one identity login, tells me im logged in as an org_admin and cant access server list.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 21:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1219633#M7869</guid>
      <dc:creator>tslack</dc:creator>
      <dc:date>2022-10-06T21:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'GIS' object has no attribute 'admin' [Only in stand alone script]!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1234908#M8055</link>
      <description>&lt;P&gt;For the record ESRI Support told me that the issue is likely because our version of Enterprise was running 10.6&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 17:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attributeerror-gis-object-has-no-attribute-admin/m-p/1234908#M8055</guid>
      <dc:creator>tslack</dc:creator>
      <dc:date>2022-11-24T17:47:13Z</dc:date>
    </item>
  </channel>
</rss>

