I am creating a basic map following the instructions from the ArcGIS API for Python tutorial (see link below).
https://developers.arcgis.com/python/guide/part5-saving-updating-and-embedding-map-widget/
When using the export_to_html method I get a bad escape \u and I cannot export the map. Is there a resolution to this error? It seems to me this error is related to this stack overflow question:
https://stackoverflow.com/questions/54330673/how-to-fix-error-bad-escape-u-at-position-0
Code (replaced API key and file path):
gis = GIS(api_key='my key')
map1 = gis.map('USA')
map1.export_to_html('file path')
Error:
Package Versions:
Python - 3.7.1
ArcGIS - 2.1.0.3
Solved! Go to Solution.
That did not solve the issue, but I did look again and it ended up being an error with the ipywidgets version. I updated to 7.7.5 (anything after version 8 causes more errors) and now it works. I can successfully export the map as an html file but now I am running into another issue where the map file is blank when I open it. Not sure if I should create another post or continue with this one for this issue.
Have you got any backlashes in your arguments? Error seems to be related to them. Maybe use a raw string for your filepath r'C:\Stuff\I Love GIS'
That did not solve the issue, but I did look again and it ended up being an error with the ipywidgets version. I updated to 7.7.5 (anything after version 8 causes more errors) and now it works. I can successfully export the map as an html file but now I am running into another issue where the map file is blank when I open it. Not sure if I should create another post or continue with this one for this issue.