I am trying to display a map using Python and the ArcGIS module and have followed the tutorial to create the basic code as seen here (note: I am using a real API key and have removed it from the post):
from arcgis.gis import GIS
from os import path, getcwd
gis = GIS(api_key="MY_API_KEY")
map = gis.map()
map.basemap = "topo-vector"
map.center = [34.027, -118.805]
map.zoom = 13
map # display the map
#Export to html
export_dir = path.join(getcwd(), "home")
if not path.isdir(export_dir):
os.mkdir(export_dir)
export_path = path.join(export_dir, "display-a-map.html")
map.export_to_html(export_path, title="Display a map")
However, when I run this code I get the following message and nothing happens:
Process finished with exit code -1073741571 (0xC00000FD)
Running in debug mode just produces a bunch of Unable to find real location for:
errors.
I have tried adding this to the start of the script to help me find the error
import faulthandler
if __name__ == "__main__":
faulthandler.enable()
Doing so produces this in the PyCharm Run window, with the last line being repeated over 100 times:
Windows fatal exception: stack overflow
Current thread 0x00007484 (most recent call first):
File "C:Program FilesPython311Libssl.py", line 742 in verify_mode
Hopefully someone can knows a solution and can help me solve this problem.
More Information:
Python Version: 3.11.0
PyCharm Version: PyCharm Community Edition 2022.2
ArcGIS Python Module Version: 2.3.0.2
Tutorial Link: https://developers.arcgis.com/python/guide/display-a-map/