AnsweredAssumed Answered

gis.content.get not working as expected

Question asked by John.Broecher on Mar 14, 2018
Latest reply on Mar 15, 2018 by John.Broecher

This script works on my Anaconda Python 3.6.4 but I need to run it from the Pro Python installation and it fails saying that the item object has no attribute export. It is supposed to download create an item and download it as a GDB do disk. It seems that  gis.content.get function results in a different object type. How can I get this to work in the Pro Python installation?

 

from arcgis.gis import *

import time

import sys

gis = GIS(username="username", password="pswd")
data_item_id = '259558969c234c669667adf956e6939d'


data_item = gis.content.get(data_item_id)
title="Test_Export" + time.strftime("%Y%m%d-%H%M%S")
print(data_item) # for testing
print(sys.version) # for testing
outputgdb = data_item.export(title=title,export_format="File Geodatabase",wait=True)

The printed output when it works (data_item and sys.version):

>>> <Item title:"Secure_SD_Roadkill" type:Feature Layer Collection owner:username>
3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]

The printed output when it fails (data_item and sys.version):

numViews=84
spatialReference='GCS_WGS_1984'
listed=False
scoreCompleteness=66
screenshots=[]
guid=None
industries=[]
created=1519400137000
_portal=<arcgis._impl.portalpy.Portal object at 0x0000000001434160>
categories=[]
languages=[]
tables=None
thumbnail='thumbnail/thumbnail.png'
_gis=<arcgis.gis.GIS object at 0x0000000001434128>
numRatings=0
banner=None
ownerFolder='71848e17504e418ea6671ab7fdfdb288'
url='https://services.arcgis.com/jWPBXspaQsJStWX8/arcgis/rest/services/Secure_SD_Roadkill/FeatureServer'
culture='en-us'
access='org'
_workdir='C:\\Users\\GFSF12~1\\AppData\\Local\\Temp'
modified=1519400162000
itemControl='admin'
commentsEnabled=True
itemid='259558969c234c669667adf956e6939d'
avgRating=0
appCategories=[]
tags=['SD', 'Roadkill', 'GFP', 'South', 'Dakota', 'ArcGIS', 'Service Definition', '.sd']
protected=False
owner='userName'
largeThumbnail=None
description=None
name='Secure_SD_Roadkill'
snippet='Secured Service that has records appended from SD Roadkill Survey123 Data.'
proxyFilter=None
id='259558969c234c669667adf956e6939d'
title='Secure_SD_Roadkill'
type='Feature Service'
typeKeywords=['ArcGIS Server', 'Data', 'Feature Access', 'Feature Service', 'Service', 'Singlelayer', 'Hosted Service']
licenseInfo=None
size=65536
properties=None
accessInformation=None
documentation=None
extent=[[-180, -90], [180, 90]]
layers=None
numComments=0
_hydrated=False
3.5.3 |Continuum Analytics, Inc.| (default, May 15 2017, 10:43:23) [MSC v.1900 64 bit (AMD64)]

Outcomes