AnsweredAssumed Answered

Problem with arcpy.MakeXYEventLayer in Python Script

Question asked by blackhole82 on Apr 25, 2018
Latest reply on Apr 26, 2018 by blackhole82

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:

 

 

import arcpy

basePath = 'C:\Users\Jason\Documents\SchoolStuff\GEO 4393C'
workspacePath = basePath+'\FinalProject\Project.gdb'

arcpy.env.workspace = workspacePath
arcpy.env.overwriteOutput = True

locationsFilePath = basePath+'\FinalProject\Locations\MiniGolfLocations.xls'
locationsTable = 'MiniGolfLocations'

arcpy.ExcelToTable_conversion(locationsFilePath,locationsTable,'MiniGolfLocations')
print 'Done converting spreadsheet to table'

arcpy.MakeXYEventLayer_management(locationsTable,'LONGITUDE','LATITUDE','USpoints')
print 'Done creating xy event layer'

arcpy.CopyFeatures_management('USpoints',workspacePath+'\USpoints')

print 'Done creating USpoints'

 

 

 

 

Has anyone else run into this problem before or have any suggestions? 

Outcomes