pandasエクセル読込エラー:ValueError: Your version of xlrd is 2.0.1. In xlrd >= 2.0, only the xls format is supported. Install openpyxl instead.

- Python -


Pythonimport pandas as pd

df = pd.read_excel('sample.xlsx')


Traceback (most recent call last):
File "", line 3, in read_excel
df = pd.read_excel('sample.xlsx')
File "/usr/local/lib/python3.8/site-packages/pandas/util/", line 299, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/", line 336, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/", line 1080, in __init__
raise ValueError(
ValueError: Your version of xlrd is 2.0.1. In xlrd >= 2.0, only the xls format is supported. Install openpyxl instead.



  • Python:3.8.6
  • pandas:1.2.1
  • xlrd:2.0.1

pandasでValueError: Your version of xlrd is〜が出た時の解決法


  1. openpyxlをインストール
  2. コードを少し書き換える

1. openpyxlをインストール

pip install openpyxl


~ $ pip install openpyxl
Collecting openpyxl
Downloading openpyxl-3.0.6-py2.py3-none-any.whl (242 kB)
|████████████████████████████████| 242 kB 5.9 MB/s
Collecting et-xmlfile
Using cached et_xmlfile-1.0.1.tar.gz (8.4 kB)
Collecting jdcal
Using cached jdcal-1.4.1-py2.py3-none-any.whl (9.5 kB)
Building wheels for collected packages: et-xmlfile
Building wheel for et-xmlfile ( ... done
Created wheel for et-xmlfile: filename=et_xmlfile-1.0.1-py3-none-any.whl size=8917 sha256=484d8588a569b150fd2dfd48ef29ad7415cbaeeaa89f2847093f7b285775792b
Stored in directory: /Users/yuki/Library/Caches/pip/wheels/6e/df/38/abda47b884e3e25f9f9b6430e5ce44c47670758a50c0c51759
Successfully built et-xmlfile
Installing collected packages: et-xmlfile, jdcal, openpyxl
Successfully installed et-xmlfile-1.0.1 jdcal-1.4.1 openpyxl-3.0.6
WARNING: You are using pip version 20.2.4; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/local/opt/python@3.8/bin/python3.8 -m pip install --upgrade pip' command.
~ $

2. コードを少し書き換える


Pythonimport pandas as pd

df = pd.read_excel('sample.xlsx', engine='openpyxl')


参考サイトstack overflow:Pandas cannot open an Excel (.xlsx) file