I recently downloaded the Python Script - "Overwrite Hosted Feature Service" to update ArcGIS Online from ArcGIS Pro. I have been using Python Script(s) to update the data from ArcMAP, but starting to use ArcGIS Pro alot more for a variety of reasons.
Trying to run this script thru Python 2.7.13 IDLE and keep getting this error:
ImportError: No module named GIS.
Is there a way to correct this or is there a different script that I can download and run to update ArcGIS Online from ArcGIS Pro thru Python IDLE and using Window's Task Scheduler?
Thank You
Solved! Go to Solution.
You'll need to run the script in a python environment that was set up in ArcGIS Pro, which deploys python 3.x as well as the ArcGIS Python API. The GIS module is within the API not Arcpy.
From How To: Overwrite hosted feature services from ArcGIS Pro to ArcGIS Online using Python :
It is possible to overwrite a hosted feature service using the arcgis.gis.module as a workaround. The module is used to overcome the known limitation of the ArcPy module, with ArcGIS Online credentials in a Python script. The Python script allows the process to be automated. However, Python 3, which is included in an ArcGIS Pro installation, is required.
Check these out:
https://developers.arcgis.com/labs/?product=python&topic=any
ArcGIS API for Python | ArcGIS for Developers
Download data | ArcGIS for Developers
Many if not all of the tutorials will have you working in a notebook, but you can really use any IDE you wish.
You answer your own question, i.e., "trying to run this script thru Python 2.7.13 IDLE..." ArcGIS Pro is bundled with Python 3, so if you are using Python 2.7.13 IDLE, it means you are running the code from some other Python 2 distribution on the machine. Make sure you open the right IDLE application.
You'll need to run the script in a python environment that was set up in ArcGIS Pro, which deploys python 3.x as well as the ArcGIS Python API. The GIS module is within the API not Arcpy.
From How To: Overwrite hosted feature services from ArcGIS Pro to ArcGIS Online using Python :
It is possible to overwrite a hosted feature service using the arcgis.gis.module as a workaround. The module is used to overcome the known limitation of the ArcPy module, with ArcGIS Online credentials in a Python script. The Python script allows the process to be automated. However, Python 3, which is included in an ArcGIS Pro installation, is required.
Check these out:
https://developers.arcgis.com/labs/?product=python&topic=any
ArcGIS API for Python | ArcGIS for Developers
Download data | ArcGIS for Developers
Many if not all of the tutorials will have you working in a notebook, but you can really use any IDE you wish.
I have the same error as @ModernElectric but the conda list also brings up an error (SyntaxError).
I am relatively new to using Python is there a step I am missing?
You provided a screenshot of a Jupyter notebook, is that the Jupyter that gets installed with Pro or do you possibly have other Python distributions on your machine that have Jupyter included too?
It is the Jupyter notebook that was installed with Pro