Confluence Retirement

In an effort to consolidate USGS hosted Wikis, myUSGS’ Confluence service is scheduled for retirement on January 27th, 2023. The official USGS Wiki and collaboration space is now SharePoint. Please migrate existing spaces and content to the SharePoint platform and remove it from Confluence at your earliest convenience. If you need any additional information or have any concerns about this change, please contact myusgs@usgs.gov. Thank you for your prompt attention to this matter.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3
minLevel2
typeflat
separatorpipe

What is the Anaconda distribution?

Anaconda is an open-source Python distribution that makes is possible to easily install and manage many pre-packaged third party Python modules. It is a competing fully open-source alternative to the Enthought Python Distribution (EPD).

...

  • Very useful tools and modules not in Esri's standard distribution are available (iPython, pandas, etc).
  • You can install and update the Python stack as a regular (non-pr) user
  • You can install and remove, and update third party packages easily, with Anaconda checking for compatibility for you 
  • A single Python install stack can be used to set up different "virtual environments" 

Workflow

The general workflow to make this happen is to:

  • Install Anaconda without fouling the Windows environment (paths, registry) to break Esri's python stack
  • Configure Anaconda with the particular add-ons you want, and
  • Configure ArcGIS's Python so that it is aware of the appropriate Anaconda content.

1) Install Anaconda (Single-User - no admin access needed)

  1. Go to http://continuum.io/downloads
  2. Download the 32-bit (x86) version of Anaconda (ArcMap [32-bit] can only directly work with 32-bit Python)
  3. In the install dialogs:
    1. Select install for a single user (Not "All Users")
    2. Install to a folder where there is going to be plenty of space (recommend the D drive, not the C drive)
    3. IMPORTANT: To avoid breaking ArcGIS, uncheck the checkboxes  (a) make Anaconda the default Python and (b) add Anaconda's Python to the PATH. 
    4. Here are screenshots to help guide you through the install process.

At this point, you will have full Anaconda version of the python environment that's spiffy and new and totally useless with ArcMap. 

2) Configure Anaconda To Work with ArcGIS

The following workflow will demonstrate how set up a custom Python environment within Anaconda that is similar to that of ArcGIS Python, and then add a compatible version pandas  module. Pandas is great for a whole variety of data processing tasks (just google "python pandas"). If you get this far, you can adapt this workflow to include any other modules you may want.

...

http://deparkes.co.uk/2015/01/29/install-shapely-on-anaconda/

3) Configure ArcGIS to see Anaconda and vice versa

This can easily be done with a Python startup script

  1. Install Anaconda, setup environment to match your ArcGIS version
  2. Edit the paths in this script (usercustomize.py.txt) to match your setup
  3. Put the script in the Python user site packages folder (must be named usercustomize.py)
    The user site-packages folder path can be found with: python -m site --user-site
    This is usually:  C:\Users\username\AppData\Roaming\Python\Python27\site-packages

Testing and Troubleshooting

  1. Start ArcMap, open the Python window
  2. type "import pandas"
  3. type "pandas."
    1. A popup menu with a list of pandas-provided functions is a pretty good sign the install succeeded.

...

  1. Get to the Anaconda Command Prompt (via the Start menu on Windows, e.g.)
  2. Type "conda install -n arc1022 pandas=0.10.0"

References

http://www.continuum.io/blog/conda

...