EGIS wiki space (here)
|Table of Contents|
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)
The general workflow to make this happen is to:
At this point, you will have full Anaconda version of the python environment that's spiffy and new and totally useless with ArcMap.
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.
The following example is for ArcGIS 10.2.2.
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')
The critical modules for compatibility are the three above. We'll also include a few others that we know are shipped the ArcGIS 10.2.2's Python stack.
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 Anaconda Command Prompt, type:
D:\Users\cprice>activate arc1022 Activating environment "arc1022"... [arc1022] D:\Users\cprice>conda list # packages in environment at D:\Users\cprice\Anaconda\envs\arc1022: # dateutil 2.4.1 py27_0 matplotlib 1.3.0 np17py27_0numpy 1.7.1 py27_3 ... [arc1022] D:\Users\cprice>python Python 2.7.5 |Continuum Analytics, Inc.| (default, Jul 1 2013, 12:41:55) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
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).
This can easily be done with a Python startup script
python -m site --user-site
If you get an error message when you try to import, the most a common cause I've seen is that the version of the module is still too new. 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 but for some mysterious ESRI-specific reason that we could not get support to solve or really talk about, pandas 0.10.1 does not work. 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 "esri" environment to hold use an older version of pandas (0.10.0 pandas and all worked. To do change this):
conda install -n arc1022 pandas=0.10.0"