Closed
Description
BUG: read_excel failing to check older xlrd versions properly #39355
I ran into this bug on pandas-2.1
without xlrd present no problem; but when installed, excel file is not loaded:
In [5]: df_ref=pd.read_excel(refprots, engine="openpyxl", na_values =[''])
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[5], line 1
----> 1 df_ref=pd.read_excel(refprots, engine="openpyxl", na_values =[''])
ImportError: Can't determine version for xlrd
In [6]: df_ref=pd.read_excel(refprots, na_values =[''])
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[6], line 1
----> 1 df_ref=pd.read_excel(refprots, na_values =[''])
ImportError: Can't determine version for xlrd
In [7]: import xlrd
In [8]: xlrd.__version__
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 1
1 xlrd.__version__
AttributeError: module 'xlrd' has no attribute '__version__'
In [9]: xlrd.__VERSION__
Out[9]: '1.1.0'
In [10]: pd.__version__
Out[10]: '2.1.4'
Originally posted by @brobr in #39355 (comment)