ArcGIS API for Python in Visual Studio Code not showing maps

2671
2
02-26-2021 03:27 AM
MarkusSchenardi
Occasional 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?
Markus Schenardi
Laixo AG - Zürich - Switzerland
Member of the Esri Partner Network
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
Occasional Contributor

Moved to: https://github.com/Esri/arcgis-python-api/issues/941

Markus Schenardi
Laixo AG - Zürich - Switzerland
Member of the Esri Partner Network
0 Kudos