langchain icon indicating copy to clipboard operation
langchain copied to clipboard

BSHTMLLoader Incorrect error message; bs4 -> beautifulsoup4

Open zilto opened this issue 1 year ago • 1 comments

The following error indicates to pip install bs4. However, to install BeautifulSoup, one should pip install beautifulsoup4

Error:

File [ENVPATH/lib/python3.10/site-packages/langchain/document_loaders/html_bs.py:26], in BSHTMLLoader.__init__(self, file_path, open_encoding, bs_kwargs)
     24     import bs4  # noqa:F401
     25 except ImportError:
---> 26     raise ValueError(
     27         "bs4 package not found, please install it with " "`pip install bs4`"
     28     )
     30 self.file_path = file_path
     31 self.open_encoding = open_encoding
     
ValueError: bs4 package not found, please install it with `pip install bs4`

zilto avatar Apr 20 '23 00:04 zilto

My bad. Cut a small PR: https://github.com/hwchase17/langchain/pull/3242

danielchalef avatar Apr 20 '23 20:04 danielchalef