import numpy as np
import xlrd

wb = xlrd.open_workbook('stud.data.xlsx')
sheet = wb.sheet_by_index(0)
print (sheet.nrows)
print(sheet.ncols)
for i in range(1,sheet.nrows):
 grades.append([int(sheet.cell(i,1).value), int(sheet.cell(i,2).value), 
 int(sheet.cell(i,3).value)])
 print grades

这是在其他PC上运行的相同python代码,但不在我的电脑上 . 错误是AttributeError:'module'对象没有属性'open_workbook' . 我在Spyder框架中运行它 . 路径或导入文件是正确的,并已多次检查 .