pip may be used to install BeautifulSoup. To install Version 4 of BeautifulSoup, run the command:
pip install beautifulsoup4
Be aware that the package name is beautifulsoup4 instead of beautifulsoup, the latter name stands for old release, see old beautifulsoup