Select to view content in your preferred language

ArcGIS API for Python in Visual Studio Code not showing maps

3396
2
02-26-2021 03:27 AM
MarkusSchenardi
Frequent Contributor

I'm trying to display a map inside a jupyter notebook running in Visual Studio Code (with the python and jupyter extension enabled).

Environment is Python 3.7 or 3.8 and arcgis (API for python) 1.8.4.

I created a new conda env as described here: https://support.esri.com/en/technical-article/000022005

Code

The code is very simple in Jupyter:

from arcgis import GIS
gis = GIS(url='https://<abc>.maps.arcgis.com',username='<username>',password='<pwd>')
mymap=gis.map('Zurich')
mymap

 

PROBLEM

As soon as a map should be displayed in the widget a white box appears with:
Unhandled Error! See the browser console. 

console warningconsole warning

 

Messages in the console:

[Embedded Page] WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] WidgetManager: Loading class ArcGISMapIPyWidgetModel:arcgis-map-ipywidget:1.8.4
webviewElement.ts:90 [Embedded Page] Fetch IPyWidget source for arcgis-map-ipywidget
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] WidgetManager: Loading class ArcGISMapIPyWidgetModel:arcgis-map-ipywidget:1.8.4
webviewElement.ts:90 [Embedded Page] Fetch IPyWidget source for arcgis-map-ipywidget
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] WidgetManager: Loading class ArcGISMapIPyWidgetView:arcgis-map-ipywidget:1.8.4
webviewElement.ts:90 [Embedded Page] Fetch IPyWidget source for arcgis-map-ipywidget
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] WidgetManager: Loading class LayoutView:@jupyter-widgets/base:1.2.0
webviewElement.ts:90 [Embedded Page] require promise
webviewElement.ts:90 [Embedded Page] Error on render:
webviewElement.ts:90 [Embedded Page] Error: Script error for "esri/Map"
https://requirejs.org/docs/errors.html#scripterror

 
* The same code runs without problems in condas jupyter notebook
* The same code also runs in VS Code when using the conda environment installed with ArcGIS Pro
 
Any suggestions how to fix this problem?
2 Replies
DanPatterson
MVP Esteemed Contributor

You might want to post an issue on their github site

Issues · Esri/arcgis-python-api (github.com)


... sort of retired...
MarkusSchenardi
Frequent Contributor
0 Kudos