xlrd是Python中直接读取Excel文件的包:
import xlrd
x_y_data = xlrd.open_workbook('Data.xlsx')
all_data = x_y_data.sheets()[0]
all_rows = all_data.nrows #行数
all_cols = all_data.ncols #列数
但是其实用pandas来读取更方便(pandas内部也需要xlrd包):
import pandas as pd
df = pd.read_excel(datafile, header=None)
data = df.values
/Users/chao/.pyenv/versions/3.6.2/lib/python3.6/site-packages
cd xlrd-1.1.0
python setup.py install