Select to view content in your preferred language

How to set up Jupyter Notebook to work with ArcGIS?

6001
10
03-29-2018 06:53 AM
AllenGuan2
Occasional Contributor

Got excited about Jupyter Notebook from the Developer Summit and anxious to install it on my laptop. I have ArcGIS desktop 10.3.1 (python 2.7) and Pro 2.1.2 (python 3.4) on my laptop. What is the best way to install the notebook that integrates with ArcGIS, meaning being able to import ArcGIS.gis and arcpy? Seems to me the easiest way to install notebook with python  is to use the Anaconda download, but the latest Anaconda has python 3.6. Can I just install Jupyter notebook without python 3.6 and hook up the notebook with the Pro python 3.4? Or if I do the Anaconda install with python 3.6, how would I hook up the notebook with Pro python 3.4 without breaking my ArcGIS desktop python 2.7. Wish ESRI had some documentation on this.

0 Kudos
10 Replies
AllenGuan2
Occasional Contributor

Just found out Pro 2.1 has Jupiter notebook built into it. Not sure how to launch it though. It gives a command line window and then nothing happens.

0 Kudos
AllenGuan2
Occasional Contributor

Ok, find the glitch. I have to remove the PYTHONPATH env variable as it points to c:\python27. Both the native jupyter notebook short cut from Pro and yours work fine. But your "Start in" works better for me. Thanks.

0 Kudos
DanPatterson_Retired
MVP Emeritus

glad it worked out Allen

0 Kudos
AllenGuan2
Occasional Contributor

Dan, actually I just tried following your link before seeing your reply. The shortcut does not seem to do anything.

Target: "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\pythonw.exe" "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts\jupyter-notebook-script.py"

Start in : W:\gis_data_admin\Admin\AllenG\JupiterNotebooks

0 Kudos
AllenGuan2
Occasional Contributor

I would think adding this "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts" to PATH environment variable, and then should be able to launch the notebook on command line:

jupyter.exe notebook,  or

jupyter-notebook.exe

But both gives the same errors as shown below.Errors when running "jupyter-notebook.exe" and "jupyter.exe notebook"

0 Kudos
XinhLe
by
New Contributor

Another solution is using archook, it can be installed by pip in Jupyter notebook.

Import Arcpy from Anaconda Jupyter Notebook_Easy and Super Quick way_save 2018 Sep - YouTube 

0 Kudos
ShaunWalbridge
Esri Regular Contributor

ArcHook doesn't look to support Pro currently. With Pro 2.1 and later, you should be able to directly use Jupyter Notebooks from the ArcGIS program group, as its included out of the box. Alternatively, you can start Python Command Prompt and then run "jupyter notebook".

0 Kudos
DanPatterson_Retired
MVP Emeritus

and you can specify a path where your notebooks are

(arcgispro-py3) C:\ArcGISPro\bin\Python\envs\arcgispro-py3>jupyter-notebook "C:\Git_Dan\JupyterNoteBooks"

0 Kudos