Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [ ] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

df = pd.read_excel("test.xlsx")

Issue Description

df = pd.read_excel("test.xlsx")

Is working as expected in that df is correct, but it is printing to screen a subset of the sheet names contained in "test.xlsx". e.g.

mysheetname 3
mysheetname 4

If, in Excel, I delete the entire contents of mysheetname 3 its name is still printed out when running read_excel. If I delete the worksheet, then create a new one with the same name, it no longer is printed to screen. So presumably these sheets contain something weird that is causing read_excel to print the sheet name to screen.

Expected Behavior

df = pd.read_excel("test.xlsx")

does not print to screen a subset of the sheet names in my workbook.

Installed Versions

INSTALLED VERSIONS ------------------ commit : 2e218d10984e9919f0296931d92ea851c6a6faf5 python : 3.10.9.final.0 python-bits : 64 OS : Windows OS-release : 10 Version : 10.0.22621 machine : AMD64 processor : Intel64 Family 6 Model 165 Stepping 2, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United Kingdom.1252 pandas : 1.5.3 numpy : 1.24.2 pytz : 2022.7.1 dateutil : 2.8.2 setuptools : 67.2.0 pip : 22.3.1 Cython : None pytest : 7.2.1 hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.10.0 pandas_datareader: None bs4 : 4.11.2 bottleneck : None brotli : None fastparquet : None fsspec : None gcsfs : None matplotlib : None numba : None numexpr : None odfpy : None openpyxl : 3.1.0 pandas_gbq : None pyarrow : None pyreadstat : None pyxlsb : None s3fs : None scipy : None snappy : None sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None xlwt : None zstandard : None tzdata : None

Comment From: rhshadrach

Thanks for the report - does this happen with all Excel files? Can you provide a reproducible example? I would be helpful if the example created the DataFrame from code, wrote it out to test.xlsx, and then read in. However, if this isn't possible, then sharing a small Excel file would work as well.

I would also suggest checking that the installation of your libraries is clean - i.e. that no one has added print calls in pandas or the Excel reading engine. I myself have been guilty of doing then when debugging on rare occasions :laughing:

Comment From: asishm

probably same issue as #51161

Comment From: rhshadrach

Thanks @asishm - Looks like this was reported and close to getting fixed: https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1978

Comment From: rhshadrach

Closing