question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visual Studio Code not showing maps with Python 3.8

See original GitHub issue

Describe the bug Trying to show a map inside jupyter notebook in Visual Studio Code when using a new conda environment (not the one from ArcGIS Pro) . The map shows an unhandled error. image

To Reproduce Steps to reproduce the behavior:

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

Write code in jupyter:

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

error

Messages in the console (browser console inside VS Code)

[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

Platform (please complete the following information):

  • OS: windows 10
  • Visual Studio Code (latest with python and jupyter extension from microsoft)
  • Python API Version [1.8.4]
  • Python 3.8

Additional context

  • 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
CMPengcommented, Mar 31, 2021

Hi @SCMGeocom and @nam-tonthat Map widget display of ArcGIS API for Python is not supported in VS code. Please try jupyter notebooks when it comes to drawing or plotting in maps. Thanks!

0reactions
jChopperEUKcommented, Oct 16, 2022

Thirded. I know that VS Code can be a bit troublesome to support but it is now a go-to all-purpose IDE for a massive amount of the developer community.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code can't find Python - Stack Overflow
Show activity on this post. In VS Code, open the Settings with (Ctrl+,) then search settings for "Interpreter." There will an option for...
Read more >
ArcGIS API for Python in Visual Studio Code not showing maps
I'm trying to display a map inside a jupyter notebook running in Visual Studio Code (with the python and jupyter extension enabled).
Read more >
Get Started Tutorial for Python in Visual Studio Code
Write a simple Python script to plot figures within VS Code. This tutorial is not intended to teach you Python itself. Once you...
Read more >
Visual Studio Code (Windows) - Setting up a Python ...
In this Python Programming Tutorial, we will be learning how to set up a Python development environment in VSCode on Windows. VSCode is...
Read more >
Mac OS Monterey Python Version? | Apple Developer Forums
I'm using an extension inside Visual Studio Code (VSC) which assumes the command ... For default Python 3.8.9, I am seeing build errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found