[Python] Deal with openpyxl warning: "Workbook contains no default style, apply openpyxl's...

Discussão em 'Python' iniciado por Stack, Janeiro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I have the -current- latest version of pandas, openpyxl, xlrd.

    openpyxl : 3.0.6.
    pandas : 1.2.2.
    xlrd : 2.0.1.

    I have a generated excel xlsx- file (export from a webapplication).
    I read it in pandas:

    myexcelfile = pd.read_excel(easy_payfile, engine="openpyxl")


    Everything goes ok, I can successfully read the file.

    But I do get a warning:

    /Users/*******/projects/environments/venv/lib/python3.8/site-packages/openpyxl/styles/stylesheet.py:214: UserWarning: Workbook contains no default style, apply openpyxl's default
    warn("Workbook contains no default style, apply openpyxl's default")


    The documentation doesn't shed too much light on it.

    Is there any way I can add an option to avoid this warning?

    I prefer not to suppress it.

    Continue reading...

Compartilhe esta Página