xlrd2
raw JSON → 1.3.4 verified Fri May 01 auth: no python
Library for developers to extract data from Microsoft Excel legacy spreadsheet files (.xls). Version 1.3.4 supports Python 2.7 and 3.4+. It is a maintained fork of the original xlrd, which dropped .xls support in version 2.0. Releases are infrequent.
pip install xlrd2 Common errors
error ModuleNotFoundError: No module named 'xlrd2' ↓
cause Trying to import xlrd2 instead of xlrd.
fix
Use 'import xlrd' after installing xlrd2.
error ModuleNotFoundError: No module named 'xlrd' ↓
cause Package not installed, or using Python environment where xlrd2 is not installed.
fix
Run 'pip install xlrd2'.
Warnings
gotcha Import as xlrd, not xlrd2. The import name is xlrd even though the package is installed as xlrd2. ↓
fix Use 'import xlrd'.
breaking xlrd (original) dropped .xls support in version 2.0. xlrd2 is the maintained fork that continues to support .xls files. ↓
fix If you need .xls support, use xlrd2 instead of xlrd 2.0+.
deprecated xlrd2 does not support .xlsx files. For .xlsx, use openpyxl or pandas. ↓
fix Use openpyxl or pandas for .xlsx files.
Imports
- xlrd wrong
import xlrd2correctimport xlrd
Quickstart
import xlrd
workbook = xlrd.open_workbook('example.xls')
sheet = workbook.sheet_by_index(0)
print(sheet.cell_value(0, 0))