Python Forum
Please help me error "AttributeError: 'module' object has no attribute 'ElementTree'"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me error "AttributeError: 'module' object has no attribute 'ElementTree'"
#1
Hi everyone,
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 sheet
After 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.
Reply


Messages In This Thread
Please help me error "AttributeError: 'module' object has no attribute 'ElementTree'" - by mattroi261192 - Nov-09-2018, 10:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error: audioio has no attribute 'AudioOut' netwrok 3 688 Oct-22-2023, 05:53 PM
Last Post: netwrok
  getpass.getpass() results in AttributeError: module 'os' has no attribute 'O_NOCTTY' EarthAndMoon 4 819 Oct-03-2023, 02:00 PM
Last Post: deanhystad
  AttributeError: '_tkinter.tkapp' object has no attribute 'username' Konstantin23 4 1,818 Aug-04-2023, 12:41 PM
Last Post: Konstantin23
  Need help with 'str' object is not callable error. Fare 4 886 Jul-23-2023, 02:25 PM
Last Post: Fare
  Python: Regex is not good for re.search (AttributeError: 'NoneType' object has no att Melcu54 9 1,577 Jun-28-2023, 11:13 AM
Last Post: Melcu54
  Parallel processing - AttributeError: Can't get attribute 'sktimekmeans' Mohana1983 1 790 Jun-22-2023, 02:33 AM
Last Post: woooee
  Python: AttributeError: 'PageObject' object has no attribute 'extract_images' Melcu54 2 4,015 Jun-18-2023, 07:47 PM
Last Post: Melcu54
  Object attribute behavior different in 2 scripts db042190 1 782 Jun-14-2023, 12:37 PM
Last Post: deanhystad
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 2,459 Apr-15-2023, 05:17 PM
Last Post: deanhystad
  working with TLV module Object Jennifer_Jone 3 1,192 Mar-14-2023, 07:54 PM
Last Post: Jennifer_Jone

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020