AnsweredAssumed Answered

Python API unable to connect to AGOL

Question asked by yguan16 on Dec 12, 2018
Latest reply on Dec 12, 2018 by yguan16

I have been running the following python API in jupyter notebook to access our company AGOL for a while. But it breaks in the last few days. I heard ESRI is changing the authentication model, could this be related or the API call is outdated this week? It worked last week.

 

from arcgis.gis import GIS
gis = GIS(url="https://bhp.maps.arcgis.com/home", username='myadminaccount',password='myadminpassword',proxy_host='....', proxy_port='8081')

 

The errors are below:

 

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\__init__.py in <module>()

      1 __version__ = '1.4.1'      2 ----> 3 from . import features, geoanalytics, geocoding, geometry, geoprocessing, network, raster, realtime, schematics, mapping, apps      4       5 from .gis import GIS C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\__init__.py in <module>()     19 """     20 ---> 21 from .feature import Feature, FeatureSet, FeatureCollection     22 from .layer import FeatureLayer, Table, FeatureLayerCollection     23 from ._data.geodataset import SpatialDataFrame C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\feature.py in <module>()     13 from arcgis._impl.common._spatial import json_to_featureclass     14 from arcgis._impl.common._utils import _date_handler---> 15 from arcgis.geometry import BaseGeometry, Point, MultiPoint, Polyline, Polygon, Geometry, SpatialReference     16 from arcgis.gis import Layer     17  C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\geometry\__init__.py in <module>()     62 """     63 ---> 64 from ._types import *     65 from .functions import *     66 from . import filters C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\geometry\_types.py in <module>()      7 from six import add_metaclass      8 try:----> 9     import arcpy     10     HASARCPY = True     11 except ImportError:C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py in <module>()     70     import _initagsenv     71 ---> 72 from arcpy.geoprocessing import gp     73 from arcpy.geoprocessing import env     74 from arcpy.geoprocessing._base import gptooldoc as _gptooldoc C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py in <module>()     12 #     13 #email: contracts@esri.com---> 14 from ._base import *C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py in <module>()     12 #     13 #email: contracts@esri.com---> 14 import arcgisscripting     15 import functools     16  RuntimeError: Not signed into Portal.

Outcomes