You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用pandas读取多Sheet Excel报错:open_workbook_2007_xml()获意外参数'pickleable'

Fix for "TypeError: open_workbook_2007_xml() got an unexpected keyword argument 'pickleable'"

This error happens due to a compatibility mismatch between your pandas and xlrd versions. Here's the breakdown: pandas 0.22.0 passes the pickleable parameter to xlrd's open_workbook function, but xlrd 1.1.0 removed support for this argument entirely, leading to the TypeError you're seeing.

Here are three straightforward solutions to get your Excel reading code working again:

Solution 1: Downgrade xlrd to a compatible version

Downgrade xlrd to version 1.0.0, which still accepts the pickleable argument that pandas 0.22.0 expects. Run this command in your environment:

pip install xlrd==1.0.0

Solution 2: Upgrade pandas to a newer version

Upgrade pandas to a release that’s compatible with xlrd 1.1.0. Versions like pandas 0.23.0 and later fixed this compatibility issue. Execute:

pip install pandas>=0.23.0

Solution 3: Use openpyxl as the Excel engine (for .xlsx files)

If your file uses the modern .xlsx format, you can switch to using openpyxl instead of xlrd. First install the library:

pip install openpyxl

Then modify your code to specify the engine explicitly:

import pandas as pd
xls = pd.ExcelFile('my_file.xlsx', engine='openpyxl')

内容的提问来源于stack exchange,提问作者Ha Luu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:41:44