Reputation: 962
This is my sample code
import xlrd
file_location=("/home/deep/Desktop/Book1.xlsx")
workbook=xlrd.open_workbook(file_location)
sheet=workbook.sheet_by_index(0)
first=sheet.cell_value(1,1)
print(first)
but i get following error into that
Traceback (most recent call last): File "/home/deep/ws/xcx.py", line 6, in workbook=xlrd.workbook(file_location) AttributeError: module 'xlrd' has no attribute 'open_workbook'
Upvotes: 3
Views: 1050
Reputation: 477
open_workbook
is perfectly fine to use. But at the last line, you should use:
first=sheet.cell(1,1)
print(first.value)
Upvotes: 0
Reputation: 907
As per your error message ,
Traceback (most recent call last): File "/home/deep/ws/xcx.py", line 6, in workbook=xlrd.workbook(file_location) AttributeError: module'xlrd' has no attribute 'open_workbook'
I guess you've made a typo error, It says
workbook=xlrd.workbook(file_location)
It must have been:
workbook=xlrd.open_workbook(file_location)
xlrd works fine for me !! Just tried it !!
Upvotes: 1