I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth
, in C:\Python27\ArcGIS10.2\Lib\site-packages
.
Has someone has faced a similar issue?
I am wondering if there is a workaround by including a path file that tells Anaconda where arcpy is installed? I tried to create a .pth file containing the following text:
# .pth file for arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.2\bin
C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.2\Scripts
and saved it to C:\Anaconda\Lib\site-packages
(that is, if this is indeed where all the packages are saved) but I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 21, in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
from _base import *
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
ImportError: DLL load failed: %1 is not a valid Win32 application.
I am running conda 3.7-py27 on a windows 7 (64bit) platform. Anaconda is installed in C:\Anaconda
and ArcMap is installed in C:\ArcGIS\Desktop10.2
. Is there an alternative solution to get arcpy to work with Anaconda? I just want to be able to run my scripts from Powershell.
Best Answer
This tutorial shows you how to set up conda environment to work with ArcGIS 10.4 and ArcGIS Pro 1.3.
Workflow to set up Anaconda with ArcGIS 10.4
1) Install Anaconda for All Users
2) Configure an Anaconda environment for use with ArcGIS
3) Configure ArcGIS to see Anaconda and vice versa
Workflow to set up Anaconda with ArcGIS Pro 1.3
1) Create an Anaconda environment that is compatible with ArcGIS Pro
2) Test the virtual environment
3) Add more packages
4) Configure ArcGIS to see Anaconda and vice versa
References