I'm testing newly installed 'xlrd' package :
#!/usr/bin/env/python
import xlrd
wb = xlrd.open_workbook('D:\excel\test.xls')
print (wb.sheets())
I run it through IDLE (Windows 7) and I get the following error message:
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "D:\excel\testxls.py", line 3, in <module>
import xlrd
File "C:\Program Files (x86)\Python33\lib\site-packages\xlrd\__init__.py", line 1187
print "EXTERNSHEET(b7-):"
^
SyntaxError: invalid syntax
>>>
Any idea on this issue?
Thanks!
xlrd is a module that allows Python to read data from Excel files.
It seems like your xlrd
file is corrupted. So update it by using the following command :
$ python3 -m pip install --upgrade xlrd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With