Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time.

I had this same problem, and I think I have found a 'universal' solution. So far we have done this on about 8 computers at work and it all works fine.

So the question: How to install a separate Python distribution with ArcGIS?

share|improve this question
add comment

1 Answer 1

Ok, so this answer works for the Anaconda 64bit Python distribution with ArcGIS 10.1 64bit on Windows 7/Windows Server

First, install anaconda, it should go to the directory C:\Anaconda. Check the box 'make system default python'. It may give a warning that there is another python installed, but continue. Then:

First thing to do is to copy over the DTBGGP64.pth file to the new distribution directory (C:\Anaconda) from C:\Python27\ArcGISx6410.1\Lib\site-packages. This will allow you to import ArcPy when using the new distribution.

Next, the environment variables must be checked: In the system variable Path, there needs to be the following paths, in this order: C:\Python27;C:\Anaconda;C:\Anaconda\Scripts.

C:\Python27 must come before the path to the new python distribution.

If there is a User Variable called PYTHONPATH, this should be deleted.

Finally, the registry keys must be checked. Normally there should be nothing to change but it is worth double-checking. Check the following keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath
There should be one key and its’ value should be C:\Anaconda\Lib;C:\Anaconda\DLLs

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath
The key should be C:\Anaconda

HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Python10.1
The PythonDir key should be *C:\Python27*

Arc's Toolboxes and integral Python console should now work fine, and you should also be able to import arcpy (and all the other 3rd party packages) from the external console(s) given with Anaconda (Spyder/Ipython etc..)

I imagine that the process would be similar for installing Python(x,y) etc.

share|improve this answer
1  
You should also mark this as the accepted answer. –  Chad Cooper Feb 18 at 13:17
    
Can't do that until 2 days have passed since posting :) –  James Feb 18 at 13:20
    
hmm...when I click the tick, I get a message saying 'you can accept your own answer in 2 days'... –  James Feb 18 at 13:28
    
Does this install all the Python dependencies ArcGIS has? matplotlib, numpy, xlrd, xlwt and dateutil? –  KHibma Feb 18 at 14:41
    
Yes. For the anaconda distribution, a full list of of packages can be found here: docs.continuum.io/anaconda/pkgs.html I am not as familiar with Python(x,y) or other distributions –  James Feb 18 at 14:43
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.