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):
<SPAN class="keyword token">import</SPAN> timeit
start <SPAN class="operator token">=</SPAN> timeit<SPAN class="punctuation token">.</SPAN>default_timer<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
<SPAN class="keyword token">from</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>sa <SPAN class="keyword token">import</SPAN> <SPAN class="operator token">*</SPAN>
imports <SPAN class="operator token">=</SPAN> timeit<SPAN class="punctuation token">.</SPAN>default_timer<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"completed arcpy imports: {} sec"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>int<SPAN class="punctuation token">(</SPAN>imports <SPAN class="operator token">-</SPAN> start<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Ideas? Thanks!