Open In App

How to Install xlrd in Python on MacOS?

Last Updated : 20 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will learn how to install xlrd library in Python on macOS. The xlrd is a library for reading data and formatting information from Excel files in the historical .xls format.

Installing xlrd Library on macOS:

Method 1: Using pip to install xlrd

Follow the below steps to install the xlrd library on macOS:

Step 1: Install the latest Python3 in MacOS.

Step 2: Check if pip3 and python3 are correctly installed.

python3 --version
pip3 --version

checking python and pip versions in macos

Step 3: Upgrade your pip to avoid errors during installation.

pip3 install --upgrade pip

upgrading pip in macos

Step 4: Enter the following command to install Beautiful Soup using pip.

pip3 install xlrd

installing xlrd on macos using pip

Method 2: Using setup.py to install XLRD

Follow the below steps to install the xlrd library using the setup.py file:

Step 1: Install the latest Python3 in MacOS

Step 2: Check if python3 is correctly installed.

python3 --version

checking python version on macos

Step 3: Download the latest package of xlrd for python3 from here.

curl https://files.pythonhosted.org/packages/a6/b3/19a2540d21dea5f908304375bd43f5ed7a4c28a370dc9122c565423e6b44/xlrd-2.0.1.tar.gz > xlrd.tar.gz

 Download the latest package of xlrd for python3

Step 4: Extract the downloaded package using the following command.

tar -xzvf xlrd.tar.gz

Extracting the xlrd package in macos

Step 5: Go inside the folder and Enter the following command to install the package.

cd xlrd-2.0.1
python3 setup.py install

installing xlrd on macos using sertup.py file

Verifying the installation:

Import the module in the python terminal to check if xlrd is installed correctly.

import xlrd

verifying xldr package installation on macos

If there is any error while importing the module then is not installed properly.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads