Select to view content in your preferred language

Calling ArcGIS Pro Python from ArcGIS Server 10.6.1 fails with -- ImportError: DLL load failed: The specified procedure coul

972
2
01-05-2021 10:25 PM
Nandha_KumarMahadevan
New Contributor

We are calling ArcGIS Pro 2.6 python from ArcGIS Server 10.6.1 GP Service through pythons subprocess library and batch file. It resulted in following error:

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packag
es\arcgisscripting\__init__.py", line 128, in <module>
from ._arcgisscripting import *
ImportError: DLL load failed: The specified procedure could not be found

Basically, the steps are 

  1. GP Initiated through REST service call
  2. GP calls a batch file through python SubProcess (import subprocess and popen method)
  3. The batch file triggers another python file using ArcGIS Pro Python like ""C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python" <python file path>/intersect.py (while running the python script, it  fails at import arcpy statement ImportError: DLL load failed: The specified procedure could not be found). Detailed error is

import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 74,
in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__
.py", line 14, in <module>
from ._base import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py
", line 14, in <module>
import arcgisscripting
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packa
ges\arcgisscripting\__init__.py", line 128, in <module>
from ._arcgisscripting import *
ImportError: DLL load failed: The specified procedure could not be found.

Earlier the same above steps were working with ArcGIS Pro 2.1 and ArcGIS Server 10.3.1.  The same not working after upgrading to ArcGIS Pro 2.6 and ArcGIS Server 10.6.1

ArcGIS Server machine has following softwares now:

  1. ArcGIS Desktop 10.6.1
  2. ArcGIS Server 10.6.1
  3. ArcGIS Pro 2.6

Kindly help to resolve this issue.

 

2 Replies
PatSmyth
New Contributor III

Hi - I'm trying to do something similar and wondering if you were ever able to find a solutions for this. Thanks 

0 Kudos
JohnAnderson1
New Contributor III

Not sure if this is relevant, but a similar error occurs if FME Server uses a python 2.7 interpreter to import arcpy when ArcGIS Server is installed on the same server. A python 3.x interpreter needs to be used. Check your python environment and system variables to make sure Python 3.x is being used. (and in the case of FME Server, double check to make sure any FME Workbenches that are being executed are configured to use Python 3.x).

0 Kudos