Module Not Found Error: "langchain.chains.question_answering"

133 views Asked by At

I am trying to code a document chat bot using langchian. I installed the following first using :

$ pip install langchain langchain-openai pypdf openai chromadb tiktoken docx2txt*

When I run try to import load_qa_chain I got the following error

from langchain.chains.question_asnwering import load_qa_chain
Module Not Found Error: no module named langchain.chains.question_answering was found

Do I need to install anything else? Please help!

I tried to install it separately using below code:

pip install langchain.chains.question_answering 

but the Terminal response was: Terminal-output

1

There are 1 answers

0
umair mehmood On

while you are importing load_qa_chain you made a typo.

❌ Incorrect import statement

from langchain.chains.question_asnwering import load_qa_chain

✅ Correct import statement

from langchain.chains.question_answering import load_qa_chain

Please follow the documentation here