Select to view content in your preferred language

CreateMapTilePackage_management Error 10054

1046
3
Jump to solution
04-09-2019 12:39 PM
JamesCrandall
MVP Frequent Contributor

Pretty straight forward script to build a .tpk from an existing .mxd that contains the desired feature class.  In fact, when the ArcToolbox is run on the same .mxd it completes as expected.  When I copy and paste the script from the Geoprocessing results window into a standalone .py script, it fails with the below error:

arcpy.CreateMapTilePackage_management(in_map="H:/directory/somename.mxd", service_type="ONLINE", output_file="H:/directory/somename.tpk", format_type="PNG", level_of_detail="10", service_file="", summary="", tags="", extent="DEFAULT")

Traceback (most recent call last):
  File "<string>", line 73, in execInThread
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 196, in __call__
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 71, in syncreq
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 431, in sync_request
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 379, in serve
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 337, in _recv
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\channel.py", line 50, in recv
  File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\stream.py", line 166, in read
EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host

0 Kudos
1 Solution

Accepted Solutions
JamesCrandall
MVP Frequent Contributor

This error is due to Background 64-bit Geoprocessing.  See THIS thread.

To fix I simply forced the script to run C:\Python27\ArcGIS10.4\python.exe, which I put into a .cmd text file.  This works perfect since I planned to run this from the Task Scheduler anyway!

View solution in original post

3 Replies
PavanYadav
Esri Contributor
JamesCrandall
MVP Frequent Contributor

Odd that the script fails when running via pyScripter but completes fine when executed from the ArcGIS toolbox tool.  I literally copied/pasted the .py snippet from the Geoprocessing results window into a new .py script file.

Thanks!

0 Kudos
JamesCrandall
MVP Frequent Contributor

This error is due to Background 64-bit Geoprocessing.  See THIS thread.

To fix I simply forced the script to run C:\Python27\ArcGIS10.4\python.exe, which I put into a .cmd text file.  This works perfect since I planned to run this from the Task Scheduler anyway!