Open In App

How to Install BeautifulSoup in Python on Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

Beautiful Soup is a Python library. It is used to pull data out of HTML and XML files. It works with your favored parser to deliver conversational ways of navigating, searching, and modifying the parse tree. It creates a parse tree for the parsed pages that are used for extracting information from the HTML which is further useful for web scraping. It is available for Python versions 2.7, 3, and above. In this article, we will look into the steps of installing the Beautiful Soup Package on the Linux Operating System.

Requirements:

Installing BeautifulSoup  package on Linux using PIP

To install the BeautifulSoup  package in Linux we have to follow the following steps:

Step 1: First of all, we will install Python3 on Linux Machine using the following command in the terminal:

sudo apt-get install python3

Installing-Python3-on-Linux

Step 2: Now, install the pip module which is required to install the packages in Python3. So we use the following command for installation:

sudo apt install python3-pip

Installing-the-pip-module

Step 3: Now, install the BeautifulSoup package by using the following command.

sudo pip3 install beautifulsoup4

or 

sudo apt-get install python3-bs4

Installing-the-BeautifulSoup-package

Verifying BeautifulSoup package installation on Linux using PIP

To verify if the BeautifulSoup package has been successfully installed in your system run the below command in Terminal:

python3 -m pip show beautifulsoup4

You’ll get the below message if the installation is completed successfully.

Verifying-BeautifulSoup-package-installation


Last Updated : 31 Jan, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads