[远程部署]: 更新最新版启动报错:ImportError: cannot import name 'BaseLanguageModel' from 'langchain.schema' (/usr/local/lib/python3.10/dist-packages/langchain/schema.py) #763
$ python3 ChuanhuChatbot.py
Traceback (most recent call last):
File "/root/ChuanhuChatGPT/ChuanhuChatbot.py", line 12, in <module>
from modules.overwrites import *
File "/root/ChuanhuChatGPT/modules/overwrites.py", line 4, in <module>
from llama_index import Prompt
File "/usr/local/lib/python3.10/dist-packages/llama_index/__init__.py", line 18, in <module>
from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/keyword_table/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/keyword_table/base.py", line 17, in <module>
from llama_index.indices.base import BaseGPTIndex, QueryMap
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/base.py", line 16, in <module>
from llama_index.indices.query.base import BaseGPTIndexQuery
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/query/base.py", line 18, in <module>
from llama_index.indices.postprocessor.node import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/postprocessor/__init__.py", line 5, in <module>
from llama_index.indices.postprocessor.node import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/postprocessor/node.py", line 11, in <module>
from llama_index.indices.response.type import ResponseMode
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/response/__init__.py", line 4, in <module>
from llama_index.indices.response.response_builder import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/response/response_builder.py", line 17, in <module>
from llama_index.indices.common_tree.base import GPTTreeIndexBuilder
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/common_tree/base.py", line 13, in <module>
from llama_index.indices.service_context import ServiceContext
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/service_context.py", line 6, in <module>
from llama_index.indices.prompt_helper import PromptHelper
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/prompt_helper.py", line 12, in <module>
from llama_index.langchain_helpers.chain_wrapper import LLMPredictor
File "/usr/local/lib/python3.10/dist-packages/llama_index/langchain_helpers/chain_wrapper.py", line 6, in <module>
from llama_index.llm_predictor.base import ( # noqa: F401
File "/usr/local/lib/python3.10/dist-packages/llama_index/llm_predictor/__init__.py", line 4, in <module>
from llama_index.llm_predictor.base import LLMPredictor
File "/usr/local/lib/python3.10/dist-packages/llama_index/llm_predictor/base.py", line 12, in <module>
from langchain.schema import BaseLanguageModel
ImportError: cannot import name 'BaseLanguageModel' from 'langchain.schema' (/usr/local/lib/python3.10/dist-packages/langchain/schema.py)
python3 ChuanhuChatbot.py
Traceback (most recent call last):
File "/root/ChuanhuChatGPT/ChuanhuChatbot.py", line 12, in <module>
from modules.overwrites import *
File "/root/ChuanhuChatGPT/modules/overwrites.py", line 4, in <module>
from llama_index import Prompt
File "/usr/local/lib/python3.10/dist-packages/llama_index/__init__.py", line 18, in <module>
from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/keyword_table/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/keyword_table/base.py", line 17, in <module>
from llama_index.indices.base import BaseGPTIndex, QueryMap
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/base.py", line 16, in <module>
from llama_index.indices.query.base import BaseGPTIndexQuery
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/query/base.py", line 18, in <module>
from llama_index.indices.postprocessor.node import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/postprocessor/__init__.py", line 5, in <module>
from llama_index.indices.postprocessor.node import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/postprocessor/node.py", line 11, in <module>
from llama_index.indices.response.type import ResponseMode
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/response/__init__.py", line 4, in <module>
from llama_index.indices.response.response_builder import (
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/response/response_builder.py", line 17, in <module>
from llama_index.indices.common_tree.base import GPTTreeIndexBuilder
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/common_tree/base.py", line 13, in <module>
from llama_index.indices.service_context import ServiceContext
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/service_context.py", line 6, in <module>
from llama_index.indices.prompt_helper import PromptHelper
File "/usr/local/lib/python3.10/dist-packages/llama_index/indices/prompt_helper.py", line 12, in <module>
from llama_index.langchain_helpers.chain_wrapper import LLMPredictor
File "/usr/local/lib/python3.10/dist-packages/llama_index/langchain_helpers/chain_wrapper.py", line 6, in <module>
from llama_index.llm_predictor.base import ( # noqa: F401
File "/usr/local/lib/python3.10/dist-packages/llama_index/llm_predictor/__init__.py", line 4, in <module>
from llama_index.llm_predictor.base import LLMPredictor
File "/usr/local/lib/python3.10/dist-packages/llama_index/llm_predictor/base.py", line 12, in <module>
from langchain.schema import BaseLanguageModel
ImportError: cannot import name 'BaseLanguageModel' from 'langchain.schema' (/usr/local/lib/python3.10/dist-packages/langchain/schema.py)
运行环境
OS: ubuntu
Server:
Gradio version:
Python version: 3.10.6
补充说明
pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
llama-index 0.5.25 requires langchain==0.0.142, but you have langchain 0.0.170 which is incompatible.
是否已存在现有反馈与解答?
是否是一个代理配置相关的疑问?
错误描述
启动失败,提示ImportError
复现操作
本来正常的,只是
git pull
到最新版,并且使用pip install -r requirements.txt
更新了依赖,再启动就报错了。错误日志
运行环境
补充说明
pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. llama-index 0.5.25 requires langchain==0.0.142, but you have langchain 0.0.170 which is incompatible.
检查日志有这个问题,版本冲突,如果改0.0.142也不行~