I'm working on a project to add point locations to a map using the arcpy.MakeXYEventLayer_managment tool in Python. This tool is acting unpredictable and causing a fatal EOFError (End Of File) exception every other time I run my script. Half the time it completes normally with no modifications. I've tried different inputs to the MakeXYEventLayer tool consisting of a .csv file, .dbf file, and a table view. None of these seem to make a difference. This is a current short snippet of the latest attempt:
<SPAN class="keyword token">import</SPAN> arcpy
basePath <SPAN class="operator token">=</SPAN> <SPAN class="string token">'C:\Users\Jason\Documents\SchoolStuff\GEO 4393C'</SPAN>
workspacePath <SPAN class="operator token">=</SPAN> basePath<SPAN class="operator token">+</SPAN><SPAN class="string token">'\FinalProject\Project.gdb'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> workspacePath
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
locationsFilePath <SPAN class="operator token">=</SPAN> basePath<SPAN class="operator token">+</SPAN><SPAN class="string token">'\FinalProject\Locations\MiniGolfLocations.xls'</SPAN>
locationsTable <SPAN class="operator token">=</SPAN> <SPAN class="string token">'MiniGolfLocations'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ExcelToTable_conversion<SPAN class="punctuation token">(</SPAN>locationsFilePath<SPAN class="punctuation token">,</SPAN>locationsTable<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'MiniGolfLocations'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'Done converting spreadsheet to table'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>MakeXYEventLayer_management<SPAN class="punctuation token">(</SPAN>locationsTable<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'LONGITUDE'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'LATITUDE'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'USpoints'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'Done creating xy event layer'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CopyFeatures_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'USpoints'</SPAN><SPAN class="punctuation token">,</SPAN>workspacePath<SPAN class="operator token">+</SPAN><SPAN class="string token">'\USpoints'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'Done creating USpoints'</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Has anyone else run into this problem before or have any suggestions?