Arcpy PackageMap_management Not Outputting Same File Size as ArcGIS Desktop Share As Map Package

07-22-2020 10:49 AM
New Contributor

Friendly GeoNet, 

I have an Arcpy script that creates an MXD and subsequently exports that MXD as an MPK. When I run the script, the output MPK file is 8 MB in size. 

If I open that same MXD in ArcGIS Desktop and package the map manually using the defaults. the output MPK file is 2 MB. 

The code I am using to package is: 

arcpy.PackageMap_management(mpktarget, output, 'PRESERVE', 'PRESERVE_ARCSDE', 'DISPLAY')

My question is: What are the best settings to use in Arcpy to replicate the Share As Map Package manual tool in ArcGIS Desktop? 

If my code above is indeed the correct settings, where should I look to trim that additional 6 MB from the script output? 

2 Replies
MVP Esteemed Contributor

Package Map—Data Management toolbox | Documentation 

any reason you don't want things save to a gdb? how much sde stuff?

and some of the other options.... do things need to be saved for all version? or just the current?

There are loads of options and comparing to arcmap may not be the fairest or easiest comparison since Pro has a lot of differences and your desired content may not be treated equally between the platforms  

... sort of retired...
0 Kudos
New Contributor II

I am having the same issue... package a map through the arcmap interface, I get a file size of around 109 MB, then when I run my python script, the package becomes ~327 MB.
I did some testing with different parameters, but the results remain the same. 

This was the original line: 

arcpy.PackageMap_management(PublishedModel_mxd, PublishedModel_mpk, "PRESERVE", "CONVERT_ARCSDE", "DEFAULT", "ALL", "DESKTOP", "REFERENCED", "ALL", "", "", "")

and I also tested the code with switching around the Convert_data parameter, the convert_arcsde_data parameter and the reference_all_data parameter.

After some testing, I think the issue was with the version parameter. Choosing the versions Current (10.8), 10.6 and 10.5 versions together got my map package to the same size as the map package from the manual tool. 

The default from the model seems to be ALL versions, and that is different from the default manual interface option. 

0 Kudos