I'm trying to use the ArcGIS API for Python without ArcPy. I've written a basic script that connects to a WFS, creates a FeatureLayer, then FeatureSet. I then tried to use the FeatureSet.save() function to simply save the data to a local Shapefile. When I run the script (in the Idle IDE), I get an error saying: "ImportError: ArcPy is required to export a feature class". From a few other threads that I've read, I should be able to run this without ArcPy. Any thoughts?
from arcgis.features import FeatureLayer
from arcgis.features import FeatureSet
hurricaneDir = r'C:/Workspace/Temp'
PastTracksURL = 'https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/Active_Hurricanes_Sampler/FeatureServer/3'
feature_layer = FeatureLayer(PastTracksURL)
feature_set = feature_layer.query(out_fields='*')
feature_set.save(hurricaneDir, "PastTracks_Temp_Data.shp")
print ("WFS Data Successfully Saved as a Shapefile")Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
======= RESTART: C:\Workspace\Temp\WFS_to_FeatureClass_forEsriSupport.py =======
Traceback (most recent call last):
File "C:\Workspace\Temp\WFS_to_FeatureClass_forEsriSupport.py", line 10, in <module>
feature_set.save(hurricaneDir, "PastTracks_Temp_Data.shp")
File "C:\Workspace\Python_Virtual_Environment\Lib\site-packages\arcgis\features\feature.py", line 1409, in save
raise ImportError("ArcPy is required to export a feature class.")
ImportError: ArcPy is required to export a feature class.Results