How to set up Jupyter Notebook to work with ArcGIS?

3048
10
03-29-2018 06:53 AM
Highlighted
New Contributor III

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.

Reply
0 Kudos
10 Replies
Highlighted
New Contributor III

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.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor
Reply
0 Kudos
Highlighted
New Contributor III

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.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

glad it worked out Allen

Reply
0 Kudos
Highlighted
New Contributor III

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

Reply
0 Kudos
Highlighted
New Contributor III

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"

Reply
0 Kudos
Highlighted
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 

Reply
0 Kudos
Highlighted
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".

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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"

Reply
0 Kudos