我正在尝试使用 langchian 编写文档聊天机器人。我首先使用安装了以下内容:
*pip install langchain langchain-openai pypdf openai chromadb tiktoken docx2txt*
Then I started importing required libraries that I got this error:
*Module Not Found Error: no module named "langchain.chains.question_answering" was found*
after running below code:
从 langchain.chains.question_asnwering 导入 load_qa_chain
Do I need to install anything else?
Please help!
I tried to install it separately using below code:
pip 安装 langchain.chains.question_answering
but the Terminal responsed:
[enter image description here](https://i.stack.imgur.com/XXPr1.png)
当您导入 load_qa_chain 时,您犯了一个拼写错误。
❌ 错误的进口声明
from langchain.chains.question_asnwering import load_qa_chain
✅ 正确的进口声明
from langchain.chains.question_answering import load_qa_chain
请按照文档此处