<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error running python script 000816 (arcpy)??? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521711#M17355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My below code is erroring on the last line.&amp;nbsp; I can run this ImportMetadata tool in ArcMap but when I export it to a python script I'm getting this error.&amp;nbsp; Why??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; stating something like Traceback: File "C:\scripts\Metadata_Importer.py", line 362 arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139" sde_DEVGIS_Laterals, "DISABLED")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "E:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 441, in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ImportMetadata raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error 000816: he tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ImportMetadata).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Import arcpy module
import arcpy


# Local variables:
Laterals_xml = "K:\\GISTeam\\Data Services\\GIS Data\\Metadata\\Laterals.xml"
sde_DEVGIS_Laterals__2_ = "Database Connections\\SQL10 (devgis - sde).sde\\sde.DEVGIS.DevDirectionalSurvey\\sde.DEVGIS.Laterals"

# Process: Import Metadata
arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139", sde_DEVGIS_Laterals__2_, "DISABLED")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jan 2011 18:19:12 GMT</pubDate>
    <dc:creator>JoshV</dc:creator>
    <dc:date>2011-01-13T18:19:12Z</dc:date>
    <item>
      <title>Error running python script 000816 (arcpy)???</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521711#M17355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My below code is erroring on the last line.&amp;nbsp; I can run this ImportMetadata tool in ArcMap but when I export it to a python script I'm getting this error.&amp;nbsp; Why??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; stating something like Traceback: File "C:\scripts\Metadata_Importer.py", line 362 arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139" sde_DEVGIS_Laterals, "DISABLED")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "E:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 441, in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ImportMetadata raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error 000816: he tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ImportMetadata).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Import arcpy module
import arcpy


# Local variables:
Laterals_xml = "K:\\GISTeam\\Data Services\\GIS Data\\Metadata\\Laterals.xml"
sde_DEVGIS_Laterals__2_ = "Database Connections\\SQL10 (devgis - sde).sde\\sde.DEVGIS.DevDirectionalSurvey\\sde.DEVGIS.Laterals"

# Process: Import Metadata
arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139", sde_DEVGIS_Laterals__2_, "DISABLED")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 18:19:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521711#M17355</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2011-01-13T18:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error running python script 000816 (arcpy)???</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521712#M17356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The only thing I see is that "DISABLED" should be "DISABLE".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jan 2011 11:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521712#M17356</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2011-01-14T11:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error running python script 000816 (arcpy)???</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521713#M17357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello jvickrey79,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you solve the ImportMetadata error ? I have the same error when exporting metadata ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "D:\ExportMeta_FromModelBuilder_V2.py", line 24, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ExportMetadata_conversion(SDELAYER, ESRI_ISO2ISO19139_xml, export_xml)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 349, in ExportMetadata&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000816: The tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExportMetadata).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even when I use this code from the onlinehelp it doesn't work ????&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/fr/arcgisdesktop/10.0/help/index.html#/na/00120000000t000000/"&gt;http://help.arcgis.com/fr/arcgisdesktop/10.0/help/index.html#/na/00120000000t000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "C:/data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#set local variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dir = arcpy.GetInstallInfo("desktop")["InstallDir"]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ExportMetadata_conversion ("data.gdb/roads", translator, "roads_19139.xml")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you !...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2011 16:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521713#M17357</guid>
      <dc:creator>DanielBaril</dc:creator>
      <dc:date>2011-03-28T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error running python script 000816 (arcpy)???</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521714#M17358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello jvickrey79,&lt;BR /&gt;&lt;BR /&gt;Did you solve the ImportMetadata error ? I have the same error when exporting metadata ???&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "D:\ExportMeta_FromModelBuilder_V2.py", line 24, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ExportMetadata_conversion(SDELAYER, ESRI_ISO2ISO19139_xml, export_xml)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 349, in ExportMetadata&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000816: The tool is not valid.&lt;BR /&gt;Failed to execute (ExportMetadata).&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Even when I use this code from the onlinehelp it doesn't work ????&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;# &lt;A href="http://help.arcgis.com/fr/arcgisdesktop/10.0/help/index.html#/na/00120000000t000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/fr/arcgisdesktop/10.0/help/index.html#/na/00120000000t000000/&lt;/A&gt;&lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;env.workspace = "C:/data"&lt;BR /&gt;#set local variables&lt;BR /&gt;dir = arcpy.GetInstallInfo("desktop")["InstallDir"]&lt;BR /&gt;translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"&lt;BR /&gt;arcpy.ExportMetadata_conversion ("data.gdb/roads", translator, "roads_19139.xml")&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Thank you !...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Daniel.&amp;nbsp; I got what I needed working using the below code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Local variables...
sde_DEVGIS_Wetlands = "Database Connections\\HOU-SRVRNPRD2 (devgis - sde).sde\\sde.DEVGIS.DevelopmentAndTesting\\sde.DEVGIS.Wetlands"
Wetlands_xml = "K:\\GIS Data\\Metadata\\Wetlands.xml"

arcpy.MetadataImporter_conversion(Wetlands_xml, sde_DEVGIS_Wetlands)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:45:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/error-running-python-script-000816-arcpy/m-p/521714#M17358</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2021-12-11T22:45:22Z</dc:date>
    </item>
  </channel>
</rss>

