<?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: Script tool Execute Error  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574586#M45026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The contents of 'listing' is a list of strings of the &lt;STRONG&gt;file names&lt;/STRONG&gt;, not &lt;STRONG&gt;full paths&lt;/STRONG&gt;, which is why it can't locate your csv. You can join the folder name to the file name using &lt;A href="https://docs.python.org/2/library/os.path.html#os.path.join"&gt;os.path.join()&lt;/A&gt;, or set the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/current-workspace.htm"&gt;workspace environment&lt;/A&gt; to function as a default directory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 19:19:45 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2016-03-01T19:19:45Z</dc:date>
    <item>
      <title>Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574580#M45020</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 create a script tool to iterate over tables in a folder with the XY to line tool to create one shapefile for each table. I get the following error message: &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 3160, in XYToLine&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ERROR 000732: Input Table: Dataset myout1.csv does not exist or is not supported&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Failed to execute (XYToLine).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file exists, and it is also suitable as input for the XY to Line tool (I can use it as input file in ArcMap, also if I quit iterating and set the path as string it works fine). If I test the iteration code in a python script it also works, each file is accessed. Any ideas what could be the problem? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code: &lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="173" src="https://community.esri.com/legacyfs/online/187984_pastedImage_1.png" style="height: 173px; width: 806.466px;" width="806" /&gt;&lt;/P&gt;&lt;P&gt;I have not listed all tool parameters since the code is long and I do not think that is the problem.&lt;/P&gt;&lt;P&gt;And&amp;nbsp; I have managed to do this in modelbuilder but I need it in python for university.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would be grateful for any help! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Feb 2016 18:30:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574580#M45020</guid>
      <dc:creator>ElenaWenz</dc:creator>
      <dc:date>2016-02-27T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574581#M45021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/xy-to-line.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/xy-to-line.htm"&gt;XY To Line—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;if you use text files and &lt;/SPAN&gt;&lt;SPAN class="usertext" style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold; color: #4d4d4d; font-size: 14px;"&gt;.csv&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt; (comma-separated value) files as input, make sure that they follow the file structure specified in&amp;nbsp; &lt;/SPAN&gt;&lt;A class="xref" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/tables/tabular-data-sources.htm" style="color: #007ac2; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;About tabular data sources&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;Have you tested it manually and examined the Results window output to get the exact syntax?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/using-the-results-window.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/using-the-results-window.htm"&gt;Using the Results window—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Feb 2016 18:56:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574581#M45021</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-27T18:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574582#M45022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tables work fine with the xy to line tool (standard ArcGIS tool, script, ModelBuilder), just with this iterating code I get the error message. The code to iterate over the files also works fine when I use it in other circumstances though. The script accesses the input tables but does not seem to accept them as correct input parameters even though they are.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you mean by "get the exact syntax", in the Results window I get the same information as in the pop-up window after the script has failed (or succeeded). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Feb 2016 21:57:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574582#M45022</guid>
      <dc:creator>ElenaWenz</dc:creator>
      <dc:date>2016-02-28T21:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574583#M45023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a run that succeeds and a run that fails.. the comparison from the outputs in the results window, will identify the differences.&amp;nbsp; You may have to compare your environments settings in the results output since sometimes it is a simple, but unreported and assumed difference in the operating environment.&amp;nbsp; Again, I am not talking about the printed results from a run, but the actual results window as I reported in my last link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS just a Q... have you ever had problems using Dropbox as an origin/destination for files before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Feb 2016 22:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574583#M45023</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-28T22:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574584#M45024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message is on myout1.csv.&lt;/P&gt;&lt;P&gt;When you just run the GP on this file manually - does it works?&lt;/P&gt;&lt;P&gt;If you remove this file from the directory does it fail on the second file?&lt;/P&gt;&lt;P&gt;Sometime there are hidden chars in the file name.&lt;/P&gt;&lt;P&gt;Try to do something like this:&lt;/P&gt;&lt;P&gt;print ("[%s]" % infile)&lt;/P&gt;&lt;P&gt;and see if the print looks fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 06:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574584#M45024</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2016-02-29T06:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574585#M45025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a wild guess and I haven't tested or attempted to run this idea but perhaps you should try to copy each input table to in_memory workspace first and use that as the input, then delete it from the workspace after each iteration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for infile in listing:

&amp;nbsp;&amp;nbsp;&amp;nbsp; #remove file extesnion.&amp;nbsp; Just a guess here.
&amp;nbsp;&amp;nbsp;&amp;nbsp; inputTab = infile[:-4]

&amp;nbsp;&amp;nbsp;&amp;nbsp; #check to see if it exists and delete it if so
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(r"in_memory\\" + inputTab):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(r"in_memory\" + inputTab)

&amp;nbsp;&amp;nbsp;&amp;nbsp; #copy the input table to the in_memory workspace and use it to perform the task
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableToTable_conversion(infile, r"in_memory\", inputTab)
&amp;nbsp;&amp;nbsp;&amp;nbsp; newfeature_shp = outshape[:-4]+str(index)+".shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.XYToLine_management(inputTab, newfeature_shp, .....]
&amp;nbsp;&amp;nbsp;&amp;nbsp; index+=1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574585#M45025</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T00:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script tool Execute Error</title>
      <link>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574586#M45026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The contents of 'listing' is a list of strings of the &lt;STRONG&gt;file names&lt;/STRONG&gt;, not &lt;STRONG&gt;full paths&lt;/STRONG&gt;, which is why it can't locate your csv. You can join the folder name to the file name using &lt;A href="https://docs.python.org/2/library/os.path.html#os.path.join"&gt;os.path.join()&lt;/A&gt;, or set the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/current-workspace.htm"&gt;workspace environment&lt;/A&gt; to function as a default directory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 19:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-tool-execute-error/m-p/574586#M45026</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-03-01T19:19:45Z</dc:date>
    </item>
  </channel>
</rss>

