You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 83 DownloadAttachments.py, It does not seem to like itemObject.layers. I am using Arcgis 1.7.0 and Python 3.6.9. Do you any suggestion to how to go about fixing this without going into the arcgis module.
Line 83: for i in range(len(itemObject.layers)):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis_init_.py", line 6978, in getattribute
if self['layers'] == None or self['layers'] == []:
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis_init_.py", line 7009, in getitem
return dict.getitem(self, k)
KeyError: 'layers'
The text was updated successfully, but these errors were encountered:
Looks like if the feature layer was removed, the feature layer id either returns a NoneType, or a poorly constructed object.
First off, make sure the feature layer for the feature layer id actually exists.
If the hosted feature layer is not made publicly accessible, fill in the user name and password
Make sure your org portal URL is correct, too
#What is the ID of the Feature Layer you want to download attachments from?
FeatureLayerId = '092d075f4b3a40f78cf1329b20b0d5e7' # this one no longer exists in ArcGIS Online
#What are your ArcGIS Enterprise/ArcGIS Online credentials? This is case sensitive.
PortalUserName = '' # fill these in if Feature Layer ID above is not publicly accessible
PortalPassword = '' # fill these in if Feature Layer ID above is not publicly accessible
PortalUrl = 'https://www.arcgis.com' # fill this in with your org's URL
If that doesn't work, I'd suggest updating your arcgis library. I'm guessing you're using Windows, by the error message.
In command line (cmd.exe), possibly running as administrator:
Line 83 DownloadAttachments.py, It does not seem to like itemObject.layers. I am using Arcgis 1.7.0 and Python 3.6.9. Do you any suggestion to how to go about fixing this without going into the arcgis module.
Line 83: for i in range(len(itemObject.layers)):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis_init_.py", line 6978, in getattribute
if self['layers'] == None or self['layers'] == []:
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis_init_.py", line 7009, in getitem
return dict.getitem(self, k)
KeyError: 'layers'
The text was updated successfully, but these errors were encountered: