AttributeError: 'module' object has no attribute 'open_workbook'

Jay Jesus Amorin jay.amorin at gmail.com
Mon Jan 26 16:51:02 CET 2009


Hi,

Kindly help, I've got this error when running my script:

AttributeError: 'module' object has no attribute 'open_workbook'


Here's my code:

#!/usr/bin/python

import xlrd
import sys

mySpreadsheet = xlrd.open_workbook(open(sys.argv[1]))
firstSheet = wb.sheet_by_index(0)

for myRows in range(sh.nrows):
    print firstSheet.row_values(myRows)


Here's the error message:

root at nebuchadnezzar:/home/test/project# ./xlrd.py test.xls
Traceback (most recent call last):
  File "./xlrd.py", line 3, in <module>
    import xlrd
  File "/home/jayam/project/xlrd.py", line 6, in <module>
    mySpreadsheet = xlrd.open_workbook(open(sys.argv[1]))
AttributeError: 'module' object has no attribute 'open_workbook'


Thanks,


Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090126/37ba1123/attachment.html>


More information about the Python-list mailing list