The steps below are for a non-administrative install.
If you want to install and maintain Anaconda for all users, please go to this version of the instructions. (Admin access required)
Anaconda is an open-source Python distribution that makes is possible to easily install and manage many pre-packaged third party Python modules.
It has some big advantages over using the Python Esri provides with ArcGIS:
The general workflow to make this happen is to:
The main distribution is pretty large. MiniConda downloads what you need to do to start. Choose the Miniconda that matches the main software you want to integrate with. (You can install both if you want.)
Select install for a single user (Not "All Users")
Anaconda first run
Open the Anaconda prompt window (Search in Windows and start the shortcut "Anaconda Prompt") and enter "python"
(D:\Users\cprice\Miniconda2) C:\Users\cprice>python Python 2.7.13 |Continuum Analytics, Inc.| (default, May 11 2017, 14:07:41) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org >>>
At this point, you have a nice Anaconda Python setup (~ 225 MB) that's spiffy and new and totally useless with ArcMap.
DOI is now requiring SSL encryption. Without the setup below you will likely get a error that SSL certificates are not valid. The following steps will get you set up to use SSL so Conda will work:
mkdir %USERPROFILE%\.certificates copy %USERPROFILE%\Downloads\DOIRootCA.crt %USERPROFILE%\.certificates conda config --set ssl_verify %USERPROFILE%\.certificates\DOIRootCA.crt
The following workflow will demonstrate how set up a custom Python environment within Anaconda that has the same modules installed as ArcGIS Python, and then add a compatible version of Jupyter notebook.
The following example is for ArcGIS 10.4.1, assuming you have successfully installed MiniConda 2 32-bit (as above).
The critical modules for ArcGIS compatibility can be determined from your version of ArcGIS from the command line.
(Or you can just look at the list below under B.)
C:\Users\jwpowell> C:\Python27\ArcGIS10.2\python.exe -c ^ "import sys, numpy, matplotlib;print(sys.version, numpy.__version__, matplotlib.__version__)" ('2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]', '1.7.1', '1.3.0')
We'll also include a few other modules that we know are shipped in the ArcGIS Python stack.
Open an Anaconda command window and load the virtual environment.
C:\Users\cprice> conda info --envs # conda environments: # arc1041 D:\Users\cprice\Miniconda2\envs\arc1022 root * D:\Users\cprice\Miniconda2 D:\Users\cprice>activate arc1022 Activating environment "arc1041"... [arc1022] D:\Users\cprice> conda list # packages in environment at D:\Users\cprice\Anaconda32\envs\arc1022: # dateutil 2.4.1 py27_0 matplotlib 1.3.0 np17py27_0 numpy 1.7.1 py27_3 ...
You can add more packages using conda install, but make sure you specify version numbers for these that won't change the environment's version of python or numpy (or ArcGIS will not be able to use that environment anymore).
Let's add the Jupyter notebook and the Spyder IDE which are both popular additions to your toolbox.
Specifying python, numpy, and matplotlib versions makes sure the environment will still work with ArcGIS, and Anaconda determines the most recent compatible version of pandas (in our case, 0.13.0).
deactivate set ARCLIST=python=2.7.10 numpy=1.9.2 matplotlib=1.4.3 scipy=0.16.0 pandas pyparsing xlrd xlwt conda install -n arc1041 %ARCLIST% jupyter spyder ... The following NEW packages will be INSTALLED: ...
You can search for more packages available in conda with conda search.
You're not limited to adding only packages to which conda has access to your new environment. Here's an example on how to install a commonly desired GIS-related package (shapely) into a conda virtual environment using the python pip utility:
This can most easily be done (personal opinion) with a Python startup script
> C:\Python27\ArcGIS10.2\python.exe <path>\usercustomize.py
> activate arc1041
> python <path>\usercustomize.py
python -m site --user-site
If you get an error message when you try to import, a common cause is version incompatibilities between Esri's python environment modules and the conda modules. (Condo takes care of compatibility across its environment, but it can't know about versions Esri uses in their python install.) In the pandas example, version 0.10.1 also appears to use the same 1.6.1 version of numpy used by ArcGIS 10.1.x, but some errors occur when trying to import pandas due to some other incompatibility. The solution was to modify the Anaconda environment to use an older version of pandas (0.10.0). The other critical packages are included to avoid having Anaconda install some other incompatible packages.
conda install -n arc101 python=2.7.5 matplotlib=1.3.0 numpy=1.6.1
How to do a separate Python installation with ArcGIS? (GIS Stack Exchange)
Using ArcPy with Anaconda (PyMorton)