'MapView' object has no attribute '_preview_image_display_handler'

04-04-2021 08:44 AM
Labels (1)
New Contributor

I am trying to extract the html code out of an ArcGIS Online map from Python.

     from arcgis.gis import GIS
     import pandas as pd

    g = GIS("https://www.arcgis.com",
    "name", "password")

    p = {
    'title': '2020#12',
    'description':'test ' + \
    'dataframe object to a GIS item',
    'tags': 'python',


    i=g.content.add (item_properties=p,

    q=i.publish ()
    print (q)
    search =
    item_type="Feature Layer")

    map=g.map (location="United States")
    item=search [0]
    print (item)

   props={'title': '2020#156',
   'tags': 'python',
   "field_name": "Threat"}

   map.save (props)

   map.embed ()


I get an error for called embed ().

   AttributeError: 'MapView' object has no attribute

I have tried the export_to_html () method. It throws no error but the html code is invalid when I try and embed it in google sites.

4 Replies
New Contributor

I'm also running into this issue, it does run in jupyter notebook but not in an IDE

0 Kudos
New Contributor III

Running into the same issue in VS code and keen on finding a solution

0 Kudos
New Contributor III

Managed to solve this by updating arcgis to v3.0.3 and update .NET Desktop Runtime v6, see


However, I get another error related to numpy then

0 Kudos
New Contributor III

I got the issue again but I think I managed to solve this for good this time.

I think the the map should have been generated at least once before being embedded . This removed the "MapView" error for me. By the way, I am running my code in a notebook and use nbconvert for the html conversion.

0 Kudos