diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 1f1ad55969d6fb..d39db4e2456dbb 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -4,6 +4,7 @@ from io import BytesIO import os from textwrap import fill +import warnings from pandas._config import config @@ -791,7 +792,7 @@ def close(self): class ExcelFile: """ Class for parsing tabular excel sheets into DataFrame objects. - Uses xlrd. See read_excel for more documentation + Uses xlrd, openpyxl or odf. See read_excel for more documentation Parameters ---------- @@ -811,8 +812,14 @@ class ExcelFile: _engines = {"xlrd": _XlrdReader, "openpyxl": _OpenpyxlReader, "odf": _ODFReader} def __init__(self, io, engine=None): - if engine is None: + if engine == "xlrd" or engine is None: engine = "xlrd" + warnings.warn( + "xlrd is deprecated and will be removed in a future " + "version. Use 'openpyxl' or 'odf' instead.", + FutureWarning, + stacklevel=2, + ) if engine not in self._engines: raise ValueError("Unknown engine: {engine}".format(engine=engine))