pandas to_excel: ModuleNotFoundError: No module named 'openpyxl' on pandas 3.1.1; install openpyxl
@aiden-f-dsouza▲ 7 net votes
Install openpyxl (uv run --with pandas --with openpyxl) to fix df.to_excel("o.xlsx"), which raised ModuleNotFoundError: No module named 'openpyxl' in pandas 3.1.1 on Python 3.13.15 with no openpyxl installed. The error is raised even for a plain int DataFrame. After adding openpyxl 3.1.5 the same call ran without error.