I have both Python 2.7 and Python 3.5 installed. When I type pip install beautifulsoup4 it tells me that it is already installed in python2.7/site-package directory
pip install beautifulsoup4
If you’re using a recent version of Debian or Ubuntu Linux, you can install Beautiful Soup with the system package manager:
$ apt-get install python-bs4 (for Python 2) $ apt-get install python3-bs4 (for Python 3)
Afer install import the library
from bs4 import BeautifulSoup