Search cursor not reading excel files with Python 64

2240
2
Jump to solution
06-15-2015 10:22 AM
MichaelSouffront
New Contributor III

I can't read excel files with data access search cursor since I upgrade to Python 64 background processing. I have the office system drivers so that's not the problem. Also, I was able to read excels files fine before I upgraded. I even tried the same script in a computer running on Python 32 and then in mine with Python 64,.It worked in Python 32, but failed in Python 64 so I'm pretty sure the problem is with Python 64.

Have anyone run into this or knows how to fix it?

Here a simple example of what I can't do anymore:

import arcpy

spreadsheet = r'spreadsheet.xlsx\Sheet1$'

with arcpy.da.SearchCursor(spreadsheet, 'name') as cursor:
     for row in cursor:
          print row[0]

Thanks,

Michael

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

do you not have to specify paths to the file or is it know already or added to arcmap?  All threads I have seen show examples with the full path specified.  For example,

arcgis desktop - How do I know if I am running 64-bit background geoprocessing on ArcMap 10.2? - Geo...

EDIT

This might explain it

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

Unsupported data types

The following data types are unsupported in 64-bit processing:

If your workflow involves any of the above data types, you can execute the tool in the foreground by disabling background processing or convert your data to a supported type, then execute the tool in the background.

NoteNote:

Coverage data is supported as input to tools, but it is not a valid output type.

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

do you not have to specify paths to the file or is it know already or added to arcmap?  All threads I have seen show examples with the full path specified.  For example,

arcgis desktop - How do I know if I am running 64-bit background geoprocessing on ArcMap 10.2? - Geo...

EDIT

This might explain it

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

Unsupported data types

The following data types are unsupported in 64-bit processing:

If your workflow involves any of the above data types, you can execute the tool in the foreground by disabling background processing or convert your data to a supported type, then execute the tool in the background.

NoteNote:

Coverage data is supported as input to tools, but it is not a valid output type.

MichaelSouffront
New Contributor III

Uhh, that sucks. I thought there would be a work around or something.

0 Kudos