langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
94.4k stars 15.26k forks source link

DOC: Naively following "Build a Local RAG Application" in v0.2 docs throws a BeautifulSoup import error #24991

Open salfaris opened 3 months ago

salfaris commented 3 months ago

URL

https://python.langchain.com/v0.2/docs/tutorials/local_rag/

Checklist

Issue with current documentation:

I was following the "Build a Local RAG Application" tutorial from the v0.2 docs, and especially followed the Setup steps for installing all the relevant packages:

# Document loading, retrieval methods and text splitting
%pip install -qU langchain langchain_community

# Local vector store via Chroma
%pip install -qU langchain_chroma

# Local inference and embeddings via Ollama
%pip install -qU langchain_ollama

I think I followed every step of the tutorial correctly, yet, when I tried to run the next coming steps in the tutorial, I was thrown a ModuleNotFoundError: No module named 'bs4' suggesting that we are missing a pip install BeautifulSoup step.

In particular, running the .load method from langchain_community.document_loaders.WebBaseLoader raises the ModuleNotFoundError. Clearly, this method relies on BeautifulSoup.

So either I am missing some install steps in the Setup or a step to install BeautifulSoup is canonically missing from the tutorial which we should add for completeness.

An easy fix, of course, is to simply add pip install beautifulsoup4 somewhere in the setup stage of the tutorial.

Cheers, Salman

Idea or request for content:

No response

dosubot[bot] commented 3 days ago

Hi, @salfaris. I'm helping the LangChain team manage their backlog and am marking this issue as stale.

Your report highlights a problem with the "Build a Local RAG Application" tutorial in the v0.2 documentation, specifically regarding a ModuleNotFoundError for BeautifulSoup. You suggested adding an installation step for BeautifulSoup to the tutorial to prevent this error, but there have been no further comments or responses from the team or other users.

Could you please let us know if this issue is still relevant to the latest version of the LangChain repository? If it is, feel free to comment here to keep the discussion open. Otherwise, you can close the issue yourself, or it will be automatically closed in 7 days. Thank you!