Install BeautifulSoup in Python

The most popular installation option is:

pip install beautifulsoup4

Install beautiful soup on Windows

If you install BeautifulSoup on Windows, you can use PIP. This Package manager allows you to do it in an easy way.

First, open Command-Line, and enter this command:

pip install beautifulsoup4

After installation, you can import the library into your code.

from bs4 import BeautifulSoup

Install beautiful soup on Linux

In the recent versions of Ubuntu and Debian BeautifulSoup is available as a package. That’s mean that you can use the Linux package manager apt-get to install this library.

sudo apt-get install python-bs4

PIP

The next way to do it is to use the same tool as with Windows, namely PIP. The command looks like this:

sudo pip install beautifulsoup4

easy_install

There is also an easy_install module to install Python packages, but this module is depreciated, so YOU SHOULDN’T USE IT.

This is how the syntax looks like:

sudo easy_install beautifulsoup4

Install beautiful soup on Mac

Also on Mac, you can use the PIP installer.

pip install beautifulsoup4

Install beautiful soup using PyCharm

If you use the PyCharm editor for your work, you can use the built-in tool to install packages.

Navigate to File >> Settings (Ctrl + Alt + S) and choose Project Interpreter.

Click the plus (+) sign to add a new package.

Type beautifulsoup, and choose beautifulsoup4 and Install package.