Hi everyone,
I have trouble when I code python as below.
I have a simple code:
I have trouble when I code python as below.
I have a simple code:
import xlrd file_location = "D:\Training\Python\Email\aa.xlsx" workbook = xlrd.open_workbook(file_location) sheet = workbook.sheet_by_index(0) print sheetAfter I run the program, it shows error:
Error: workbook = xlrd.open_workbook(file_location)
File "C:\Python27\lib\site-packages\xlrd-1.0.0-py2.7.egg\xlrd\__init__.py", li
ne 422, in open_workbook
ragged_rows=ragged_rows,
File "C:\Python27\lib\site-packages\xlrd-1.0.0-py2.7.egg\xlrd\xlsx.py", line 7
84, in open_workbook_2007_xml
ensure_elementtree_imported(verbosity, logfile)
File "C:\Python27\lib\site-packages\xlrd-1.0.0-py2.7.egg\xlrd\xlsx.py", line 5
2, in ensure_elementtree_imported
Element_has_iter = hasattr(ET.ElementTree, 'iter')
AttributeError: 'module' object has no attribute 'ElementTree'
I tried installing xlrd 1.10 (latest version)and xlrd 1.0.0 version. Please help me to fix this problem. Thank all.