skip to Main Content

I am trying to use beautiful soup in VSCode on Windows 10; I was told to import beautiful soup with the line "from bs4 import Beautiful Soup" but I keep getting the error message that the module cannot be found. I definitely downloaded beautifulsoup, is there a specific place I am supposed to unzip the files?

I tried moving the files I unzipped from the beautifulsoup zip drive into the same folder as the programs I am working on, but to no avail. I expected the warning message to go away if I did this but it is still there.

Thank you

P.S. this is my first time posting a question on here; I see people ask for OS so I said I am using windows 10 and VSCode, what other info is generally required/wanted?

3

Answers


  1. Assuming that you have pip installed along with python, all you need to do is run pip install beautifulsoup4 or python3 -m pip install beautifulsoup4 in a command prompt window. Using pip is the recommended way to install and use python modules, and it is the easiest and fastest method.

    I was told to import beautiful soup with the line "from bs4 import Beautiful Soup"

    Also make sure you are importing BeautifulSoup from bs4 (no space), otherwise an error will be thrown.

    Alternatively, you can follow the instructions on this webpage about installing bs4 using the tarball. Let me know if you have any problems with this.

    Login or Signup to reply.
  2. Make sure u have BeautifulSoup installed, run pip install beautifulsoup4

    Change from bs4 import Beautiful Soup to from bs4 import BeautifulSoup

    Login or Signup to reply.
  3. Ensure that you’ve chosen the correct python interpreter.

    You can use shortcuts Ctrl+Shift+P and type Python: Select Interpreter to choose the python interpreter which you installed the package in.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search