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

4028
12
Jump to solution
10-03-2017 01:36 PM
JamesGustine
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

1 Solution

Accepted Solutions
JoshuaBixby
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
JoshuaBixby
MVP Esteemed Contributor

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

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor
0 Kudos
JamesGustine
New Contributor III
0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

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

0 Kudos
JamesGustine
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. 

0 Kudos
JoshuaBixby
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

JamesGustine
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. 

RandyMcGregor2
Regular Contributor

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

Thank you,

Randy McGregor

0 Kudos
AaronPulver
Esri Regular Contributor

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