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.
Comment: minor edits

...

  1. Open the Anaconda prompt (32 or 64, depending on the ArcGIS environment you are integrating with)
  2. Create a compatible environment
    1. 32-bit (ArcMap, ArcCatalog)
      ArcGIS 10.2.2:  "conda create -n arc1022 python=2.7.5 numpy=1.7.1 matplotlib=1.3.0 pyparsing xlrd xlwt"
      ArcGIS 10.3.1:  "conda create -n arc1031 python=2.7.8 numpy=1.7.1 matplotlib=1.3.0 pyparsing xlrd xlwt"
      ArcGIS 10.4.1:  "conda conda create -n arc1041 python=2.7.10 numpy=1.9.2 matplotlib=1.4.3 scipy=0.16.0 pandas pyparsing xlrd xlwt "  *NOTE* Esri shipped 0.15.0, but I needed to use 0.16.0 to have conda work
      ArcGIS 10.5: "conda create -n arc105 python=2.7.12 numpy=1.9.2 matplotlib=1.4.3  scipy=0.17.0 pandas pyparsing xlrd xlwt"
      ArcGIS 10.5.1: "conda create -n arc1051 python=2.7.13 numpy=1.9.3 matplotlib=1.5.2  scipy=0.17.0 pandas pyparsing xlrd xlwt"
    2. 64-bit (Background Geoprocessing (x64), ArcGIS Pro
      ArcGIS 10.x x64 background processing: same as above, from Anaconda 64-bit prompt, for example:
          "conda create -n arc105x64 python=2.7.12 numpy=1.9.2 matplotlib=1.4.3  scipy=0.17.0 pandas pyparsing xlrd xlwt"
      ArcGIS Pro 1.2: "conda create -n arcpro12 python=3.4.3 numpy=1.9.3 matplotlib=1.4.3 scipy=0.16.0 pandas pyparsing xlrd xlwt"
      ArcGIS Pro 1.3: "conda  conda create -n arcpro13 python=3.4.4 numpy=1.10 matplotlib=1.4.3 scipy=0.16.1 pandas pyparsing xlrd xlwt"
      ArcGIS Pro 2.0: "conda create -n arcpro20 python=3.5.2 numpy=1.11.2 matplotlib=1.5.3 scipy=0.18.1 pandas pyparsing xlrd xlwt"
  3. The conda tool will:
    • Determine that the specified package versions are compatible with each other.
    • Find any packages on which these depend and determine most recent 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.
    • Download (only) the packages you need to "overlay" onto the base environment to get the environment you have specified.
    • Set up a environment subdirectory, (D:\Users\jwpowell\Miniconda2\envs\arc1041 in our example) installing the downloaded packages into it. This adds up to about 1.5 GB in our ArcGIS 10.4.1 example.

...

Code Block
languagetext
titleAnaconda command prompt
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. There's a nice list on the Anaconda website that describes them all.

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:

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

Pinning dependencies

Conda does provide a method for pinning dependencies to an environment so you don't have to specify them each time (as: ARCLIST above). You need to list these packages in a filed called pinned in the conda-meta folder. 

 

...

languagetext
titleAnaconda command prompt

...

Pinning dependencies

Conda does provide a method for pinning dependencies to an environment so you don't have to specify them each time (as: ARCLIST above). You need to list these packages in a filed called pinned in the conda-meta folder. 

 
Code Block
languagetext
titleAnaconda command prompt
C:\Users\jwpowell> activate arc1041
(arc1041) C:\Users\jwpowell>(echo python ==2.7.10 & echo numpy ==1.9.2 & echo matplotlib ==1.4.3 & echo scipy ==0.16.0) > %CONDA_PREFIX%\conda-meta\pinned
(arc1041) C:\Users\cprice>typejwpowell>type %CONDA_PREFIX%\conda-meta\pinned
python ==2.7.10
numpy ==1.9.2
matplotlib ==1.4.3
scipy ==0.16.0

 

...

 

Now that this has been set up, conda install -n arc1041 scipy-0.18.1 will generate an error, and conda install six will update six to the highest version compatible with the pinned modules.

Finding more packages

You can search for more packages available in conda with conda search. There's a nice list on the Anaconda website that describes them all.

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:

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

4) Configure ArcGIS python to see Anaconda environment and vice versa

...