Problem: Converting metadata to XLST format using Python causes ArcGIS Desktop to crash or fails with an error
Attempting to convert metadata to XLST format using Python causes ArcGIS Desktop to crash or fails with the following error:
Error: 000582: Error occurred during execution
The following are two causes for the conversion to fail:
Scenario 1: Python script crashes unexpectedly
The script is executed in a 64-bit environment or 64-bit background geoprocessing is turned on. This is an expected behavior. Conversion tools in the Metadata toolset are not supported in the 64-bit processing environment.
Scenario 2: Error 000582: Error occurred during execution
Conversion tools are based on C# programming language, and do not run natively in Python. Therefore, a Python script must have the required DLL files to be able to understand the calling of the desired tools.
Solution or Workaround
Use one of the following solution suggested according to the situation involved:
Turn off 64-Bit background geoprocessing and ensure the script is executed using Python 32-bit version. To check whether the script is running using a 32-bit or 64-bit geoprocessing environment, add the following code snippet in the beginning of the script:
import arcpy import os, sys, string #Show 32bit or 64bit Python/Geoprocessing import ctypes print "4 == 32bit, 8 == 64bit" print ctypes.sizeof(ctypes.c_voidp)
When using the script outside of ArcGIS, referencing the XSLT transformation and metadata importer tool requires the DLL files to be loaded in the script. Follow the instruction to load the DLL files in order for the script to work.
- Open Windows Explorer.
- Navigate to C:\Program Files\ArcGIS\Desktop10.X\Bin
- Copy the following DLL files:
- Navigate to C:\WINDOWS\assembly
- Paste the two DLL files into the folder.
- Restart the machine and run the script.
Note: The folder, C:\WINDOWS\assembly is known as the Global Assembly Cache (GAC).
- ArcGIS for Desktop Help: XSLT Transformation
- ArcGIS for Desktop Help: Background Geoprocessing (64-bit)
- ArcGIS for Desktop Help: 000582: Error occurred during execution.