AttributeError: 'GIS' object has no attribute 'admin'

2936
12
Jump to solution
10-03-2017 01:36 PM
Highlighted
New Contributor III

Just starting to play around with the ArcGIS API for Python. I am stuck trying to call server submodule under the admin module. My install can't seem to find either. Just running thru this code on the reference page doesn't work for me.

from arcgis.gis import GIS

gis = GIS("https://portalname.domain.com/portal", "username")
gis_servers = gis.admin.servers.list()

print (gis_servers)
gis doesn't give me access to an admin property



AttributeError: 'GIS' object has no attribute 'admin'

Any clues as to where I am going wrong here would be awesome. Probably something super simple
but thanks in advance.

James

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Esteemed Contributor

Double check which version of the API you are using.  The releases come fast enough that I have been tripped up by following the documentation when I forgot to upgrade to the latest version.

View solution in original post

12 Replies
Highlighted
MVP Esteemed Contributor

My first thought is permissions.  What permissions does username have in Portal?

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor
Reply
0 Kudos
Highlighted
New Contributor III
Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

same one, different page, mine is the api reference section

Reply
0 Kudos
Highlighted
New Contributor III

Its an admin account with full rights. Seems to be able to get to and manage portal stuff just can't get the servers. to note:

I'm connecting thru the web adaptor url and the servers are federated. I've tried putting in the FQ server name but that doesn't seem to make a difference. 

Thanks. 

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Double check which version of the API you are using.  The releases come fast enough that I have been tripped up by following the documentation when I forgot to upgrade to the latest version.

View solution in original post

Highlighted
New Contributor III

That did it Josh. Had to run the update from conda

conda upgrade -c esri arcgis

I was trying to upgrade from the python package manager in Pro, but apparently that didn't do it. 

Thanks again man. 

Highlighted
Occasional Contributor III

Where does one enter this? I've tried entering it in the python window and get an "Invalid Syntax" message.

Thank you,

Randy McGregor

Reply
0 Kudos
Highlighted
Esri Regular Contributor

You run the command in Command Prompt (Windows) or Terminal (Mac/Linux) after activating the Conda environment that you are using.