When I try to read data from a hosted feature service into a spatially enabled dataframe I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\jhuillery\Desktop\JH_PY\work_alone\venv\lib\site-packages\arcgis\features\geo\_accessor.py", line 3112, in from_layer
raise Exception("Could not load the dataset: %s" % str(e))
Exception: Could not load the dataset: '__deepcopy__'
Python: 3.10.11
Arcgis API: 2.2.0.3
pandas: 2.2.1
I don't have ArcGIS Pro installed on this machine.
Sample code:
from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
gis = GIS(username='<username>', password='<pw>')
data = FeatureLayerCollection(<valid_url>, gis)
df = pd.DataFrame.spatial.from_layer(data.layers[0])
Solved! Go to Solution.
Solved by downgrading Pandas to 2.0.2
Solved by downgrading Pandas to 2.0.2