Search code examples
pythonpandaspandas.excelwriter

Can I create Excel workbooks with only Pandas (Python)?


In the pandas documentation, it says that the optional dependencies for Excel I/O are:

xlrd/xlwt: Excel reading (xlrd) and writing (xlwt)

openpyxl: openpyxl > version 2.4.0 for writing .xlsx files (xlrd >= 0.9.0)

XlsxWriter: Alternative Excel writer

I can't install any external modules. Is there any way to create an .xlsx file with just a pandas installation?

Edit: My question is - is there any built-in pandas functionality to create Excel workbooks, or is one of these optional dependencies required to create any Excel workbook at all?

I thought that openpyxl was part of a pandas install, but turns out I had XlsxWriter installed.


Solution

  • The pandas codebase does not duplicate Excel reading or writing functionality provided by the external libraries you listed.

    Unlike the csv format, which Python itself provides native support for, if you don't have any of those libraries installed, you cannot read or write Excel spreadsheets.