AnsweredAssumed Answered

arcpy unable to load gapy (DLL load failed)

Question asked by heathjr on Oct 1, 2020

After reinstalling ArcGIS Pro v2.6 on my Windows 10 64-bit machine, I get the error below when I import arcpy. As a result I can't run any Python scripts in ArcGIS Pro - if I tried to use the Python Window in ArcGIS Pro, the application gets stuck and I had to use Task Manager to close it.

 

I can get the Python environment working by editing C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox.py to remove all import statements from .ga. As I don't have a GA license, I don't have any issues with this GA classes not being imported, but the situation still doesn't seem ideal and I imagine future Pro updates may overwrite my modifications which I would then have to reapply.

 

While I'm up and running now, I would appreciate any insight anyone could offer as to why this is happening. 

>>> import arcpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 79, in <module>
from arcpy.toolbox import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox.py", line 403, in <module>
from .ga import SearchNeighborhoodStandard, SearchNeighborhoodSmooth,
SearchNeighborhoodStandardCircular, SearchNeighborhoodSmoothCircular,
SearchNeighborhoodStandard3D, CrossValidationResult, GeostatisticalDatasets
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ga.py", line 33, in <module>
from arcpy import _ga
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_ga.py", line 30, in <module>
import gapy
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\gapy\__init__.py", line 1, in <module>
from ._gapy import *
ImportError: DLL load failed: The specified procedure could not be found.

This is my paths output

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python36.zip
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\DLLs
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages
C:\Program Files\ArcGIS\Pro\bin
C:\Program Files\ArcGIS\Pro\Resources\ArcPy
C:\Program Files\ArcGIS\Pro\Resources\ArcToolbox\Scripts
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\future-0.18.2-py3.6.egg
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pytz-2019.3-py3.6.egg
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pywin32security
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\sympy-1.5.1-py3.6.egg

Additional details in case it helps:

  1. Have a standard ArcPro license, but other colleagues with the same license aren't having the same problem as me.
  2. Previously had ArcGIS Pro 2.6.1 installed and successfully running Python scripts as normal
  3. Had an issue where I couldn't publish and Web Tools to our Portal - part of the process of resolving this I decided to reinstall ArcGIS Pro
  4. After that reinstall is when I started encountering this error
  5. Did an uninstall and removed all folders / registry keys that were left over
    1. still no luck after reinstalling
  6. Repeated 5, but this time removed every trace of Python on my system
    1. still no luck
  7. Updating to 2.6.1 then 2.6.2 made no difference
  8. Reinstalled Pro but edited the toolbox.py file as mentioned above - now working (as far as I can tell).

Outcomes