Select to view content in your preferred language

The map does not display in Jupyter

1311
5
12-26-2022 06:48 PM
swang
by
Emerging Contributor

Hello there - I am new to ArcGIS API for Python, and had a simple issue in running the test codes as shown below.  I used both conda and pip install arcgis to set up the environments, Both have the same issue. When running it, it says the following errors.  In my situation, I do not have ArcGIS Pro installed at all, as we are planning to develop a project that solely depends on ArcGIS API for Python. Actually, we tested in two situations 1) has ArcGIS Pro, 2) No ArcGIS Pro.  Both have the same error.  Any help is greatly appreciated.

Shuqing

Capture.PNG

 

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

Did you follow the installation instructions for the available options on this page?

Esri/arcgis-python-api: Documentation and samples for ArcGIS API for Python (github.com)

scroll down to the What's included section.

Any other install method will likely fail.


... sort of retired...
0 Kudos
swang
by
Emerging Contributor

Thank you very much.  I followed the steps the document illustrated as below

1. Install miniconda3

2. Create an environment as conda create -n arcgisenv Python=3.7

3.Activate arcgisenv as conda activate arcgisenv

3. Install arcgis api as conda install arcgis as conda install -c esri arcgis

4. All above succeeded without any error, then launch Jupyter as 

(arcgisenv) C:\>jupyter nbextension enable arcgis --py --sys-prefix
Enabling notebook extension arcgis/extension...
- Validating: ok

(arcgisenv) C:\>jupyter lab

However during step 3, I did get the following error.  Not sure if this is case.

Thank you very much for the help.

Shuqing

Preparing transaction: done
Verifying transaction: -
SafetyError: The package for ipykernel located at C:\Users\shuqing.wang\AppData\Local\miniconda3\pkgs\ipykernel-5.1.1-py37_1
appears to be corrupted. The path 'share/jupyter/kernels/python3/kernel.json'
has an incorrect size.
reported size: 222 bytes
actual size: 159 bytes

0 Kudos
DanPatterson
MVP Esteemed Contributor

The error may be the root of your problem.  Make sure that you don't have any previous attempts at clones or installs around before you begin the creation process.  You must be working with an older version since python 3.9 is being used for Pro,  is there a reason that you want to use 3.7?


... sort of retired...
0 Kudos
swang
by
Emerging Contributor

Thanks.  I was using 3.9.  But it does not work (the same error).  So I went to ArcGIS Pro folder and noticed that python version there is 3.7.  I guessed that we might have to use 3.7 instead.  Then, I make to conda environment with Python=3.7.  It turns out it does not matter.  3.7 and 3.9 both failed with the same error.  I even removed every thing, including miniconda3.  Simply install Python 3.9 in my profile, and install arcgis by pip install arcgis. Then start jupyter by Jupyter Lab. All the same, not working at all.  I just want to see the map showing in Jupyter first.  My ultimate goal is to use ArcGIS API for Python independent of Jupyter.  The journey so far is so rough.  Thank you very much!

 

0 Kudos
swang
by
Emerging Contributor

Even tried to install it on two machine (windows 10 and 11).  all the same error. Is ArcGIS API for Python a well accepted product from ESRI?  Had been using ArcGIS API for JavaScript for many year, no issue at all.  Thanks

0 Kudos