I am trying to open excel.xlsx file with python, but cannot find a way to do this, I tried using pandas, but he wanted to use a library called NumPy. I tried to install numpy, but it still cannot find numpy.
I also tried using the xlrd library, but I get the following trace:
Traceback (most recent call last): File "C:\test.py", line 3, in <module> book = open_workbook('test.xlsx') File "C:\Python27\lib\site-packages\xlrd\__init__.py", line 370, in open_workbook biff_version = bk.getbof(XL_WORKBOOK_GLOBALS) File "C:\Python27\lib\site-packages\xlrd\__init__.py", line 1323, in getbof raise XLRDError('Expected BOF record; found 0x%04x' % opcode) XLRDError: Expected BOF record; found 0x4b50
What do I assume because XLRD cannot read .xlsx files?
Does anyone have any ideas?
EDIT:
import csv with open('test.csv', 'rb') as csvfile: data = csv.reader(csvfile, delimiter=',') for row in data: print "------------------" print row print "------------------" for cell in row: print cell
source share