Select to view content in your preferred language

Issue with pydantic

86
1
19 hours ago
HamzaMerini
Occasional Contributor

Hi everyone,

I'm migrating from ArcGIS Pro 3.1 to 3.4 and updating my code from `arcgis.mapping.WebMap` to `arcgis.map.Map` accordingly.

**Environment:**
- ArcGIS Pro 3.4
- arcgis 2.4.0
- arcgis-mapping 4.30.0
- Python 3.11 (conda env)
- Windows 10

**The issue:**
When instantiating `Map(item=webmap_item)`, I get the following error:

```
TypeError: 'MockValSer' object is not an instance of 'SchemaSerializer'
File "...arcgis\map\map_widget.py", line 488, in _update_source
self._webmap_dict = self._webmap.dict()
File "...arcgis\map\_dataclasses\_webmap_spec.py", line 73, in dict
d = super().model_dump(
File "...pydantic\main.py", line 475, in model_dump
return self.__pydantic_serializer__.to_python(
```

This seems to be a conflict between `arcgis-mapping 4.30.0` and pydantic v2. I've tried multiple pydantic v2 versions (2.4.0, 2.5.0, 2.13.4) with their matching `pydantic-core` versions, reinstalling from both pip and conda-forge, but the error persists.

Has anyone successfully used `arcgis.map.Map` on Windows with ArcGIS Pro 3.4? If so, what exact version of pydantic are you running?

Thanks!

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

2.4.2 according to the package release by version document

arcpy/docs/ArcGIS-Pro-Python-Distribution-By-Release.pdf at main · Esri/arcpy


... sort of retired...
0 Kudos