xlrd读取excel的一个奇怪错误
阿凯99 2016-02-26 11:20:15 今天试用python3.5读取excel,发生一件奇怪的事情,简单的2个语句,竟然报错:
import xlrd
data = xlrd.open_workbook(filename = 'aaa.xls' )
Traceback (most recent call last):
File "F:\xlrd.py", line 1, in <module>
import xlrd
File "F:\xlrd.py", line 3, in <module>
data = xlrd.open_workbook(filename = 'aaa.xls' )
AttributeError: module 'xlrd' has no attribute 'open_workbook'
奇怪的是,把上述2个语句放在shell中一句一句地执行,是正常的。
我的环境为:windows10,python3.5.1,excel2016
本人用python2、3年了,第一次遇见如此怪事。