I don't know if it is a bug or my lack of python skills, but I keep getting 'ERROR 000816 The tool is not valid' in my python script when I call ExportMetadata_conversion

Initially, I was attempting this on an sde database, but then I tried to take a step back just match the example in the documentation and use a file geodb:

import arcpy
from arcpy import env
env.workspace = "C:/data"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"
arcpy.ExportMetadata_conversion ("data.gdb/roads", translator, 

But I received the same error.

If anyone is successfully calling this method, does your code match the documentation?

  • I used the code sample you posted above and just substituted my data. It ran fine and generated the output xml file. I'm running ArcInfo 10 on XP.
    – Zachary
    Sep 22, 2010 at 13:47
  • Did you ever resolve the above issue with ESRI? I'm getting the same error! Thanks, Frank
    – user5139
    Dec 13, 2011 at 16:37
  • I ended up using @Kenton Williams answer. No resolution with Esri apart from a bug ID, which I don't have (this was logged at my previous employer and I didn't keep the ID). Dec 13, 2011 at 18:51

3 Answers 3


I've had better success using the XSLTransform_conversion operation in my Python geoprocessing scripts. There are a few ESRI-supplied XSL files in the C:\Program Files\ArcGIS\ArcToolBox\Stylesheets directory (on a 32-bit machine). Here's an example of the line using the XSL transform I used in a python script I published to ArcGIS Server:

results = gp.XSLTransform_conversion(inputFC, xslFile, outputFileName)

This returns a formatted file. I chose to have HTML as an output, but it will output XML if you want.


You have to use the 32-bit version of python. I know this is an old post but someone might stumble on it looking for an answer. See https://geonet.esri.com/thread/94637.

  • this is the right answer (sad as it is) Mar 13, 2019 at 18:58

Python Errors in IDLE, but Works in ArcCatalog???

You need to use GacUtil to register the DLL's properly for Metadata so that ArcPy can use them. All instructions are in the ArcGIS forum post link above.

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.