How can I install BeautifulSoup? I keep getting "No module named bs4"

When I try to import Beautifulsoup

import bs4

I keep getting the error

ImportError: No module named bs4

I have tried to address this by trying all of the following (individually and together) with Python 3 and have had no success. What's going wrong?

sudo pip3 install beautifulsoup4
sudo apt-get install python3-bs4
2

1 Answer

The following approach appears to be working:

sudo pip3.6 install bs4
from bs4 import BeautifulSoup

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like