Python 3.x 调用pandas.excel文件时发生TypeError

Python 3.x 调用pandas.excel文件时发生TypeError,python-3.x,pandas,Python 3.x,Pandas,我正试图打开一个包含一些表的excel文件,并不断出现以下错误: TypeError: unsupported operand type(s) for <<: 'str' and 'int' 此外,我使用以下方法得到相同的错误: pd.read_excel(io.open(encoding=sys.getfilesystemencoding())) 我可以正常使用open()打开文件 我正在windows 8.1上使用python 3.4和pandas 0.16.2 有什么线索吗

我正试图打开一个包含一些表的excel文件,并不断出现以下错误:

TypeError: unsupported operand type(s) for <<: 'str' and 'int'
此外,我使用以下方法得到相同的错误:

pd.read_excel(io.open(encoding=sys.getfilesystemencoding()))
我可以正常使用open()打开文件

我正在windows 8.1上使用python 3.4和pandas 0.16.2


有什么线索吗?

好的,以下两种解决方案有效:

xl = pd.ExcelFile(str(io))
以及:


(感谢第二行的SSC)

在哪一行引发了异常?当您使用open()时,是否可以尝试添加“b”以指定excel文件为二进制文件?例如,
io.open(encoding=encoding,'rb')
io.open('rb')工作正常,谢谢
xl = pd.ExcelFile(str(io))
xl = pd.ExcelFile(io.open('rb'))