install beautifulsoup

How to Install Beautifulsoup on Ubuntu & Windows

The first time I tried to install beautifulsoup to scrape the web on my Ubuntu system I had a hard time deciding which version to choose and I did not know if it was compatible with Python 3. Also, if you are a Windows user you will get an idea from this post how you can install BeautifoulSoup on your system.

Install BeautifulSoup

You can install BeautifulSoup on either Linux or Windows. The recent version of this library(beautifulsoup4) supports python 2 and python 3 too. You should already have Python installed.

Installation on Ubuntu

If you haven’t already installed pip you should do it now:

apt-get update
apt-get -y install python-pip
  1. Install beautifulsoup4 with pip.
pip install beautifulsoup4

This version supports python 2 and python 3 as well.

Installation on Windows with PIP

If you’re planning to work with python on your Windows in the future I suggest that you should install pip so you can download python packages faster and easier from the command line. You will probably need to open Command Prompt as an administrator.

  1. Download from here.
  2. Open CMD and cd to the folder you’ve just downloaded it and run it
cd C:\Users\Attila\Desktop\Folder

Pip is installed on your system. You can test it by checking its version:

pip -V

3. Install beautifulsoup with pip

pip install beautifulsoup4

Installation on Windows without PIP

You can also install it on Windows without PIP.

  1. Download the latest package from here and extract it.
  2. Open CMD and cd to the folder you’ve just extracted it.
cd C:\Users\Attila\Desktop\Folder\beautifulsoup4-4.1.0

3.Run with install

python install

It will copy a bunch of files and if everything’s installed properly it will work fine.

Now that you’ve installed beautifulsoup on your machine you should check out Web Scraping in Python with Beautifulsoup to create your first web scraper!

Follow us on Twitter to keep up with Web Scraping!