更新过langchain还是提示langchain.chat_models找不到 #408
Answered
by
luoye2333
TypicalSpider
asked this question in
Q&A
-
lee@VM-0-3-ubuntu:~/gptDemo01/ChuanhuChatGPT$ pip3 install langchain --upgrade
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: langchain in /home/lee/.local/lib/python3.8/site-packages (0.0.27)
Requirement already satisfied: pyyaml in /home/lee/.local/lib/python3.8/site-packages (from langchain) (6.0)
Requirement already satisfied: sqlalchemy in /home/lee/.local/lib/python3.8/site-packages (from langchain) (2.0.7)
Requirement already satisfied: pydantic in /home/lee/.local/lib/python3.8/site-packages (from langchain) (1.10.7)
Requirement already satisfied: requests in /home/lee/.local/lib/python3.8/site-packages (from langchain) (2.28.2)
Requirement already satisfied: numpy in /home/lee/.local/lib/python3.8/site-packages (from langchain) (1.24.2)
Requirement already satisfied: typing-extensions>=4.2.0 in /home/lee/.local/lib/python3.8/site-packages (from pydantic->langchain) (4.5.0)
Requirement already satisfied: idna<4,>=2.5 in /home/lee/.local/lib/python3.8/site-packages (from requests->langchain) (3.4)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/lee/.local/lib/python3.8/site-packages (from requests->langchain) (3.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /home/lee/.local/lib/python3.8/site-packages (from requests->langchain) (2022.12.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/lee/.local/lib/python3.8/site-packages (from requests->langchain) (1.26.15)
Requirement already satisfied: greenlet!=0.4.17 in /home/lee/.local/lib/python3.8/site-packages (from sqlalchemy->langchain) (2.0.2)
lee@VM-0-3-ubuntu:~/gptDemo01/ChuanhuChatGPT$ python3 ChuanhuChatbot.py
Traceback (most recent call last):
File "ChuanhuChatbot.py", line 10, in <module>
from modules.overwrites import *
File "/home/lee/gptDemo01/ChuanhuChatGPT/modules/overwrites.py", line 4, in <module>
from llama_index import Prompt
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/__init__.py", line 18, in <module>
from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/indices/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/indices/keyword_table/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/indices/keyword_table/base.py", line 16, in <module>
from llama_index.indices.base import DOCUMENTS_INPUT, BaseGPTIndex
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/indices/base.py", line 23, in <module>
from llama_index.indices.prompt_helper import PromptHelper
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/indices/prompt_helper.py", line 12, in <module>
from llama_index.langchain_helpers.chain_wrapper import LLMPredictor
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/langchain_helpers/chain_wrapper.py", line 6, in <module>
from llama_index.llm_predictor.base import ( # noqa: F401
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/llm_predictor/__init__.py", line 4, in <module>
from llama_index.llm_predictor.base import LLMPredictor
File "/home/lee/.local/lib/python3.8/site-packages/llama_index/llm_predictor/base.py", line 10, in <module>
from langchain.chat_models import ChatOpenAI
ModuleNotFoundError: No module named 'langchain.chat_models' |
Beta Was this translation helpful? Give feedback.
Answered by
luoye2333
Mar 27, 2023
Replies: 2 comments 2 replies
-
这个我也遇到了,需要用3.8以上版本的python。报错是因为langchain在python3.8能装的版本太老https://www.piwheels.org/project/langchain/ |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Keldos-Li
-
same problem when upgrade openai lib version=0.28, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个我也遇到了,需要用3.8以上版本的python。报错是因为langchain在python3.8能装的版本太老https://www.piwheels.org/project/langchain/
所以用python3.9就行