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.

...

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 an Anaconda virtual environment a custom Python environment within Anaconda that is similar to that of ArcGIS Python, with the "pandas" module added. 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 other modules you may want.

...

A. Find the versions of numpy and matplotlib Arc ArcGIS is using.

Open ArcMap and its Python window, and enter these commands:

>>> 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')

B. Create an a custom Anaconda virtual environment (including pandas) that is compatible with ArcGIS 10.2.2.

Rather than modifying the basic Anaconda installation, you can create a custom environment within Anaconda and specify the version of Pandas you want there. To do this:

  1. Get to the Anaconda Command Prompt (Start > Search > Anaconda, pick "Anaconda Command Prompt")
  2. Type "conda create -n arc1022 python=2.7.5 numpy=1.7.1 matplotlib=1.3.0 xlrd=0.9.2 xlwt=0.7.5 pyparsing=1.5 pandas"
    or, better yet, use this file (conda_arc1022.txt) that has a more complete list (version for use with x64 Anaconda: arc1022x64.txt)
    "conda create --file conda_arc1022.txt"  
  3. Anaconda's conda command will then:
    • Determine that the specified package versions are compatible with each other.
    • Find any packages on which these depend and determine most recent
  • compatible versions of packages not completely specified Prompts
    • versions that are compatible with what you've asked for, if not completely specified.
    • Show you what it plans to do and prompts you to continue.
  • Downloads
    • Download (only) the
  • pieces
    • packages you need to "overlay"
  • with
    • onto the base environment to get the environment you have specified.
    • Set up a subdirectory
  • in the
    • , "<Anaconda install
  • folder "
    • folder>/envs/arc1022"
  • and downloads these
    • , installing the downloaded packages into it.

C. Test the virtual environment

Since this new custom environment is not the Anaconda default, you need to let it know that's what you want to use. Then, you'll ask it to tell you what's installed. So, at the Get to the Anaconda Command Prompt, type:

D:\Users\cprice>activate arc1022

...

You can add more packages using conda install, but make sure you specify dependencies so you version numbers for these that won't change your the environment's version of python or numpy versions(or ArcGIS will not be able to use that environment anymore). For example, if we didn't add pandas in the beginning, we could add it using this command. Specifying python and numpy versions makes sure we get a compatible version that won't break will work seamlessly with arcpy/ArcGIS.

conda install -n arc1022 python=2.7.5 numpy=1.7.1 pandas

You're not limited to adding only packages to what which conda has , now that you have a virtual environment you can use it to install packages that are not available through conda install. However, it's up to you to make sure the package you install is compatible with your access to your new environment. Here's an example on how to install a commonly desired GIS-re-ated module related package (shapely) into a conda virtual environment using the python pip utility:

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

Here is some general information on the conda utility. 

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

3) Configure ArcGIS to see Anaconda and vice versa

...