1

This runs in the ArcGIS Python window but not from the IDLE command prompt.

import arcpy
import os
from arcpy import env

env.overwriteOutput = True
arcpy.env.workspace = "D:/Production/MobileData/FireAssets.gdb"

mxdLocation = "D:/Production/MobileData/MobileAssets.mxd"
tempFile = "D:/Production/MobileData/FireMobile_Assets.mpk"


arcpy.PackageMap_management(in_map=mxdLocation, output_file=tempFile, convert_data="CONVERT", convert_arcsde_data="CONVERT_ARCSDE", extent="MAXOF", arcgisruntime="RUNTIME", version="10.2")

This works fine in my ArcMap 10.7 Python Window but fails in IDLE or Python.

This is the error I get:

enter code here
    Traceback (most recent call last):
  File "D:\Production\MobileData\TEST.py", line 12, in <module>
    arcpy.PackageMap_management(in_map=mxdLocation, output_file=tempFile, convert_data="CONVERT", convert_arcsde_data="CONVERT_ARCSDE", extent="MAXOF", arcgisruntime="RUNTIME", version="10.2")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.7\ArcPy\arcpy\management.py", line 8884, in PackageMap
    raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (PackageMap).

This map packages layers from Enterprise geodatabase, FGDB, and a shapefile and exports to a 10.2 runtime map package for our mobile map. The basic script ran fine for years on ArcMap 10.3 - then one day it did not, and we are not sure what update jacked it up.

I ended up upgrading the machine and upgrading to ArcMap 10.7. The script runs in ArcMap python window, but not standalone.

I ran analyzer and corrected all errors for descriptors, tags, etc. I made sure all the layers were using the same connection reference using the find and replace sde connection command. I rebuilt the FGDB for 10.7. I ran check geometry and repaired null values on one layer. All common solutions for PackageMap general error 999999.

I checked the PATH variables C:\Python27\ArcGISx6410.7.
I added a set PATH for C:\Python27\ArcGIS10.7 and removed the 64bit path but that was not it. IDLE still launches in 64bit.

I read somewhere that PackageMap will not work with 64-bit background processing and that you need to call the 32-bit version of Python. I tried changing the PATH to C:\Python27\ArcGIS10.7 but IDLE is still running in 64-bit. I tried to find the executable for 32 bit IDLE but had no success. Still researching the correct executable for IDLE 32.

I have learned how to call the script from a DOS CMD prompt and that basically worked by changing my directory to location of 32bit Python and then running myscript.py.

I still want to use 32bit IDLE to test and debug my scripts.

  • Can IDLE run in 32-bit after installing a 64bit version?
2
  • I believe the issue was initially caused by installing the 64bit background geo-processor. The script runs from the command line only if you explicitly tell it which python interpreter to use. C:\Python27\ArcGIS10.7>python D:\Production\MobileData\Python_PackageMap_Assets.py
    – CarolineM
    May 17, 2021 at 20:57
  • So I continue to try understanding my problem - When I installed the ESRI 64bit background processing it seems to have registered paths for that version of IDLE etc. So I can call scripts from the command line that run in 32 bit, but if I try to use IDLE it calls the 64bit IDLE - The original script choked because the 64bit version will not run PackageMap.
    – CarolineM
    May 25, 2021 at 20:51

1 Answer 1

1

PackageMap does not work in the 64bit interpreter.
So the simple solution to the error message above is to run the script in the 32 bit interpreter by calling it explicitly from the command prompt when you call your script. Windows> C:\Python27\ArcGIS10.7>python.exe D:\Production\MobileData\Python_PackageMap_Assets.py.
The 64 bit interpreter installed with the 64 bit background geoprocessing and created new PATH and other environment variables. I am not skilled enough to run multiple interpreters yet and will investigate virtualenv. I have not been able to launch the 32bit IDLE but that is another research project.
Thank you GIS Stack Exchange
P.S. Several other users very old questions helped me figure this much out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.