Problem with metadata tools at 10.0 (Works as a model but not in Python)

318
4
06-28-2011 01:39 PM
RandyKreuziger
Occasional Contributor III
I have a simple script that runs in 9.2 but doesn't in 10.0.  I've isolated the problem down to the USGSMPTranslator_conversion command.  It runs in 9.2 in Python but not at 10.0.  So to test things at 10.0 I created a model using only the USGSMPTranslator converstion tool.  This tool puts out to a file metadata from a feature class.  The model works but not as a python program when exported.   As you can see below there isn't must to it.  As a model it does report metadata errors in the log file but that shouldn't be a problem.  Any ideas?


---------------Program Below-----------------------------------------

# Import arcpy module
import arcpy

# Local variables:
ws_occurpoint_dr = "L:\\data_release\\phs_development\\digitaldata\\Randy10\\project.mdb\\ws_occurpoint_dr"
ws_occurpoint_dr_full_xml = "L:\\data_release\\phs_development\\digitaldata\\Randy10\\wdfw_phs\\ws_occurpoint_dr_full.xml"
Log_File = "L:\\data_release\\phs_development\\digitaldata\\Randy10\\wdfw_phs\\ws_occurpoint_dr_full.log"

# Process: USGS MP Metadata Translator
arcpy.USGSMPTranslator_conversion(ws_occurpoint_dr, "", "XML", ws_occurpoint_dr_full_xml, Log_File)



---------------Error Message Below-----------------------------------------------

Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "L:\data_release\phs_development\digitaldata\Randy10\usgsmetadataexport.py", line 18, in <module>
    arcpy.USGSMPTranslator_conversion(ws_occurpoint_dr, "", "XML", ws_occurpoint_dr_full_xml, Log_File)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 620, in USGSMPTranslator
    raise e
AttributeError: Error in getting tool information
Tags (2)
0 Kudos
4 Replies
JasonScheirer
Occasional Contributor III
0 Kudos
DanPatterson_Retired
MVP Emeritus
Also see this blog for information on converting models to scripts.
0 Kudos
RandyKreuziger
Occasional Contributor III
Thank you jscheirer for the solution.  I installed the .NET Framework SDK so I would have the gacutil.exe.  Using that command I registered the two ESRI DLLs.


See this thread.
0 Kudos
curtvprice
MVP Esteemed Contributor
There are a bunch of related NIM's on this, all having to do with the above .dll issue and metadata tools in the 10.0 Conversion toolbox. Hopefully this will be fixed in SP4. (Unfortunately I don't see any of these NIM's on the current 10.0 SP4 "issues to be addressed"...)

NIM058011
NIM063624
NIM068626
NIM063624
NIM063623
NIM062944
NIM070175

Several of the NIM's mention a possible workaround if you can't do the GAC/.dll fix: try wrapping the tool inside a model and call that from Python.
0 Kudos