I highly recommend xlrd for reading .xls files. But there are some limitations(refer to xlrd github page):

Warning

This library will no longer read anything other than .xls files. For alternatives that read newer file formats, please see http://www.python-excel.org/.

The following are also not supported but will safely and reliably be ignored:

- Charts, Macros, Pictures, any other embedded object, including embedded worksheets.
- VBA modules
- Formulas, but results of formula calculations are extracted.
- Comments
- Hyperlinks
- Autofilters, advanced filters, pivot tables, conditional formatting, data validation

Password-protected files are not supported and cannot be read by this library.

voyager mentioned the use of COM automation. Having done this myself a few years ago, be warned that doing this is a real PITA. The number of caveats is huge and the documentation is lacking and annoying. I ran into many weird bugs and gotchas, some of which took many hours to figure out.

UPDATE:

For newer .xlsx files, the recommended library for reading and writing appears to be openpyxl (thanks, Ikar Pohorský).

Answer from taleinat on Stack Overflow
Top answer
1 of 13
113

I highly recommend xlrd for reading .xls files. But there are some limitations(refer to xlrd github page):

Warning

This library will no longer read anything other than .xls files. For alternatives that read newer file formats, please see http://www.python-excel.org/.

The following are also not supported but will safely and reliably be ignored:

- Charts, Macros, Pictures, any other embedded object, including embedded worksheets.
- VBA modules
- Formulas, but results of formula calculations are extracted.
- Comments
- Hyperlinks
- Autofilters, advanced filters, pivot tables, conditional formatting, data validation

Password-protected files are not supported and cannot be read by this library.

voyager mentioned the use of COM automation. Having done this myself a few years ago, be warned that doing this is a real PITA. The number of caveats is huge and the documentation is lacking and annoying. I ran into many weird bugs and gotchas, some of which took many hours to figure out.

UPDATE:

For newer .xlsx files, the recommended library for reading and writing appears to be openpyxl (thanks, Ikar Pohorský).

2 of 13
65

You can use pandas to do this, first install the required libraries:

$ pip install pandas openpyxl

See code below:

import pandas as pd

xls = pd.ExcelFile(r"yourfilename.xls") # use r before absolute file path 

sheetX = xls.parse(2) #2 is the sheet number+1 thus if the file has only 1 sheet write 0 in paranthesis

var1 = sheetX['ColumnName']

print(var1[1]) #1 is the row number...
🌐
OpenPyXL
openpyxl.readthedocs.io
openpyxl - A Python library to read/write Excel 2010 xlsx/xlsm files — openpyxl 3.1.3 documentation
openpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files. It was born from lack of existing library to read/write natively from Python the Office Open XML format. All kudos to the PHPExcel team as openpyxl was initially based on PHPExcel.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.read_excel.html
pandas.read_excel — pandas 3.0.6 documentation - PyData |
Supports xls, xlsx, xlsm, xlsb, odf, ods and odt file extensions read from a local filesystem or URL.
🌐
Python-excel
python-excel.org
Python Resources for working with Excel - Working with Excel Files in Python
Library with a unified api for reading and writing files with older Excel format (xls), Excel 2010 format (xlsx), OpenDocument Spreadsheet format (ods), and many others.
🌐
XlsxWriter
xlsxwriter.readthedocs.io
Creating Excel files with Python and XlsxWriter — XlsxWriter
XlsxWriter is a Python module that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
🌐
GeeksforGeeks
geeksforgeeks.org › python › reading-excel-file-using-python
Reading an excel file using Python - GeeksforGeeks
June 16, 2026 - ... openpyxl provides low-level access to excel files. It’s useful when you need to work with individual cells, rows, columns, formulas, or formatting. ... import openpyxl df = openpyxl.load_workbook("student_data.xlsx") df1 = df.active for ...
🌐
DataCamp
datacamp.com › tutorial › python-excel-tutorial
Python Excel Tutorial: Read, Write & Format Excel With openpyxl | DataCamp
June 3, 2026 - After downloading the dataset, import the Openpyxl library and load the workbook into Python: import openpyxl wb = openpyxl.load_workbook('videogamesales.xlsx')
🌐
Real Python
realpython.com › openpyxl-excel-spreadsheets-python
A Guide to Excel Spreadsheets in Python With openpyxl – Real Python
July 17, 2026 - Now that you know the basics of iterating through the data in a workbook, let’s look at smart ways of converting that data into Python structures. As you saw earlier, the result from all iterations comes in the form of tuples. However, since a tuple is nothing more than a list that’s immutable, you can easily access its data and transform it into other structures. For example, say you want to extract product information from the sample.xlsx spreadsheet and into a dictionary where each key is a product ID.
Find elsewhere
🌐
PyPI
pypi.org › project › pyexcel-xls
pyexcel-xls · PyPI
A wrapper library to read, manipulate and write data in xls format. Itreads xlsx and xlsm format
🌐
Microsoft Support
support.microsoft.com › en-us › office › get-started-with-python-in-excel-a33fbcbe-065b-41d3-82cf-23d05397f53d
Get started with Python in Excel | Microsoft Support
Or use the function =PY in a cell to enable Python. After entering =PY in the cell, choose PY from the function AutoComplete menu with the Down arrow and Tab keys, or add an opening parenthesis to the function: =PY(. Now, you can enter Python code directly into the cell.
🌐
SitePoint
sitepoint.com › blog › programming › using python to parse spreadsheet data
Using Python to Parse Spreadsheet Data — SitePoint
November 6, 2024 - Python, with the help of libraries like Pandas and openpyxl, can be used to parse spreadsheet data, including reading and writing XLSX files, CSV files, and legacy spreadsheets.
🌐
TutorialsPoint
tutorialspoint.com › python_data_science › python_processing_xls_data.htm
Python - Processing XLS Data
import pandas as pd with pd.ExcelFile('C:/Users/Rasmi/Documents/pydatasci/input.xlsx') as xls: df1 = pd.read_excel(xls, 'Sheet1') df2 = pd.read_excel(xls, 'Sheet2') print("****Result Sheet 1****") print (df1[0:5]['salary']) print("") print("***Result Sheet 2****") print (df2[0:5]['zipcode'])
🌐
Data to Fish
datatofish.com › read_excel
How to Import an Excel File Into Python using pandas
Create a Python script that loads the excel file into a pandas DataFrame and prints it to the terminal: ... import os import pandas as pd desktop_path = os.path.expanduser("~/Desktop") df = pd.read_excel(desktop_path + "/fish.xlsx") print(df)
🌐
Pyexcel
docs.pyexcel.org
pyexcel - Let you focus on data, instead of file formats — pyexcel 0.7.6 documentation
"Age": 26 ... } ... ] >>> pyexcel.save_as(records=a_list_of_dictionaries, dest_file_name="your_file.xls")
🌐
Python Basics
pythonbasics.org › home › pandas › read excel with python pandas
Read Excel with Python Pandas - pythonbasics.org
Read Excel files (extensions:.xlsx, .xls) with Python Pandas. To read an excel file as a DataFrame, use the pandas read_excel() method. You can read the first s
🌐
GeeksforGeeks
geeksforgeeks.org › python › working-with-excel-spreadsheets-in-python
Working with Excel Spreadsheets in Python - GeeksforGeeks
July 23, 2025 - In this example, a Python program uses the openpyxl module to read an Excel file ("gfg.xlsx"), opens the workbook, and retrieves the value of the cell in the first row and first column, printing it to the console.
🌐
Hakibenita
hakibenita.com › fast-excel-python
Fastest Way to Read Excel in Python | Haki Benita
January 3, 2024 - Openpyxl is a library for reading and writing Excel files in Python. Unlike Tablib, Openpyxl is dedicated just to Excel and does not support any other file types. In fact, both tablib and pandas use Openpyxl under the hood when reading xlsx files.
🌐
LearnPython.com
learnpython.com › blog › python-package-for-excel
Best Python Packages for Excel | LearnPython.com
These include .xlsm (a macro-enabled file format,) and the binary file format .xlsb for Excel 2007 and Excel 2010. There are also template file formats, including .xltx and .xltm (a macro-enabled file format). The first Python package for Excel which we’ll discuss is openpyxl.