AnsweredAssumed Answered

Error using Python to create a TPK basemap package

Question asked by brianmcleer on Aug 9, 2018
Latest reply on Aug 10, 2018 by brianmcleer

I am trying to implement a Python routine to update a Map Tile Package that will be used for offline map downloads with Lattitude Geographics GeoCortex product. The code snippet below was an output from Model Builder. The model ran successfully and updated the TPK. When running in Python, the generic error code appears (which isn't helpful):


ERROR 999999: Error executing function.
Failed to execute (CreateMapTilePackage).


Looking for insight to see if anyone else has had this problem. 


Some troubleshooting I have done without different results:

   - Run the model from within Python calling the model from a toolbox

   - Change file paths for invalid characters

   - Tried another machine


I am on ArcGIS Desktop 10.3.1 on a Windows 8.1 system and Python version is 2.7.8. 


import arcpy, os

arcpy.env.overwriteOutput = True

# Process: Create Map Tile Package
arcpy.CreateMapTilePackage_management("C:\\Path\\To\\MXDtoBeUsed.mxd", "ONLINE", "C:\\Path\\To\\TPKtobeUsed.tpk", "PNG", "4", "", "TPKforGMAF", "Basemap")