AnsweredAssumed Answered

arcpy import is really slow (2+ minutes!!!)

Question asked by dca.uw on Feb 7, 2018
Latest reply on Mar 27, 2018 by jswoveland_Latitudegeo

When I import arcpy under the ArcGIS 10.5 python interpreter, it is REALLY slow! I am seeing times of 149 - 197 seconds. Every once in a while, it will import in about 2.5 seconds, but the 2-3 minutes times are more typical. Further info: 

  • I noticed it after borrowing a license for ArcGIS Desktop. I do need to take my laptop off the network, so going back to using the license server is not a good option. 
  • ArcMap and ArcCatalog also can take a similarly long time to start. They are stuck on "Initializing License" on the splash screen for a long time. 
  • This is in my IDE (PyDev/Eclipse), but I get the same loading python 2.7 from the DOS prompt.
  • Having ArcCatalog or ArcMap already open speeds up neither python nor opening another window of ArcCatalog/ArcMap.
  • Each of the imports below takes no less time individually than all together. 

 

Here is what I am doing to test the timing (plus using my wristwatch with ArcGIS Desktop):

import timeit
start = timeit.default_timer()
import arcpy
from arcpy import env
from arcpy.sa import *
imports = timeit.default_timer()
print("completed arcpy imports: {} sec".format(int(imports - start)))

 

Ideas? Thanks!

Outcomes