<?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 Re: Python standalone script using ArcGIS Pro license in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429609#M33767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution:&amp;nbsp;&lt;/P&gt;&lt;P&gt;......&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;for kmz in arcpy.ListFiles("*.km*"):&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp; print("CONVERTING: {0}".format(os.path.join(arcpy.env.workspace, kmz)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;kmzFile = os.path.join(arcpy.env.workspace, kmz)&lt;/STRONG&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp; arcpy.KMLToLayer_conversion(&lt;STRONG&gt;kmzFile&lt;/STRONG&gt;, out_location)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2018 17:48:37 GMT</pubDate>
    <dc:creator>JYI</dc:creator>
    <dc:date>2018-09-06T17:48:37Z</dc:date>
    <item>
      <title>Python standalone script using ArcGIS Pro license</title>
      <link>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429606#M33764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am writing some standalone code following the link&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/kml-to-layer.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/kml-to-layer.htm"&gt;KML To Layer—Conversion toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;(&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;KMLToLayer example 2 (stand-alone script)&lt;/SPAN&gt;)&amp;nbsp;to try to convert a list of .KMZ files to .lyrx files, using &lt;STRONG&gt;ArcGIS Pro license.&lt;/STRONG&gt; The sample .kmz file I used is attached. It can be opened from Google Earth.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My testing code is as simple as this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Set workspace (where all the KMZs are)&lt;BR /&gt;arcpy.env.workspace = r"C:\Work\Google_MASHUP\AdministrativeBoundary\ParkTest"&lt;/P&gt;&lt;P&gt;# Set local variables and location for the consolidated file geodatabase&lt;BR /&gt;out_location = r"C:\Work\ArcGIS_Layers_From_KMZ"&lt;/P&gt;&lt;P&gt;# Convert all KMZ and KML files found in the current workspace&lt;BR /&gt;for kmz in arcpy.ListFiles("*.km*"):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; print("CONVERTING: {0}".format(os.path.join(arcpy.env.workspace, kmz)))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; arcpy.KMLToLayer_conversion(kmz, out_location)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000732: Input KML File: Dataset Dinosaur.kmz does not exist or is not supported&lt;BR /&gt;Failed to execute (KMLToLayer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The printed result is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;CONVERTING: C:\Work\Google_MASHUP\AdministrativeBoundary\ParkTest\Dinosaur.kmz, which is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to use the Geoprocessing tool KML to Layer directly from ArcGIS Pro window to convert the .KMZ successfully but not from the above code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, using the same code, with ArcGIS Server License, I am able to run it successfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody give the suggestions on this error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JYI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 15:22:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429606#M33764</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2018-09-06T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python standalone script using ArcGIS Pro license</title>
      <link>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429607#M33765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you get the print statement to fire and show the correct path to the kmz file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 15:28:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429607#M33765</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2018-09-06T15:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python standalone script using ArcGIS Pro license</title>
      <link>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429608#M33766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it is correct:&lt;/P&gt;&lt;P&gt;CONVERTING: C:\Work\Google_MASHUP\AdministrativeBoundary\ParkTest\Dinosaur.kmz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 15:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429608#M33766</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2018-09-06T15:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python standalone script using ArcGIS Pro license</title>
      <link>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429609#M33767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution:&amp;nbsp;&lt;/P&gt;&lt;P&gt;......&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;for kmz in arcpy.ListFiles("*.km*"):&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp; print("CONVERTING: {0}".format(os.path.join(arcpy.env.workspace, kmz)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;kmzFile = os.path.join(arcpy.env.workspace, kmz)&lt;/STRONG&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp; arcpy.KMLToLayer_conversion(&lt;STRONG&gt;kmzFile&lt;/STRONG&gt;, out_location)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:48:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/m-p/429609#M33767</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2018-09-06T17:48:37Z</dc:date>
    </item>
  </channel>
</rss>

