Skip to content

pd.set_option("io.excel.xlsx.reader", "openpyxl") does not work #34252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simonm3 opened this issue May 19, 2020 · 3 comments · Fixed by #38710
Closed

pd.set_option("io.excel.xlsx.reader", "openpyxl") does not work #34252

simonm3 opened this issue May 19, 2020 · 3 comments · Fixed by #38710
Assignees
Labels
Bug IO Excel read_excel, to_excel
Milestone

Comments

@simonm3
Copy link

simonm3 commented May 19, 2020

This works fine for an xlsx file:

pd.read_excel(path, engine="openpyxl")

However if i try using set_option then read_excel fails:

pd.set_option("io.excel.xlsx.reader", "openpyxl")
pd.read_excel(path)

ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.

@simonm3 simonm3 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 19, 2020
@TomAugspurger
Copy link
Contributor

if engine is None:
engine = "xlrd"
looks buggy. That should probably be taking the engine from the pandas config.

@simonm3 can you look into it?

@TomAugspurger TomAugspurger added IO Excel read_excel, to_excel and removed Needs Triage Issue that has not been reviewed by a pandas team member labels May 19, 2020
@TomAugspurger TomAugspurger added this to the Contributions Welcome milestone May 19, 2020
@WillAyd
Copy link
Member

WillAyd commented May 20, 2020

Thanks @TomAugspurger for the link. I think there's generally an issue with the reader and respecting options.

Some historical context - maybe a year and a half ago we only had xlrd as a reader, so it was a non-issue. But we've since added openpyxl, pyxlsb, and odfpy as readers, I think without using machinery similar to the writer side for respecting options.

Certainly could use some review and improvement if @simonm3 something you are interested in

@lithomas1
Copy link
Member

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants