The most popular installation option is:
1 |
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:
1 |
pip install beautifulsoup4 |
After installation, you can import the library into your code.
1 |
from bs4 import BeautifulSoup |
Install beautiful soup on Linux
In the recent versions of Ubuntu and Debian BeautifulSoup is available as a package. That means that you can use the Linux package manager apt-get to install this library.
1 |
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:
1 |
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 what the syntax looks like:
1 |
sudo easy_install beautifulsoup4 |
Install beautiful soup on Mac
Also on Mac, you can use the PIP installer.
1 |
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.