You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LangChain 0.1.7版本导入BaseOuputParser报错问题咨询

解决ImportError: cannot import name 'BaseOuputParser' from 'langchain.schema'

你的问题由两个原因导致:

  • 类名拼写错误:你代码里的BaseOuputParser存在笔误,正确类名是BaseOutputParser(注意Output包含字母t,你漏写了)。
  • 导入路径变更:在LangChain 0.1.7版本中,BaseOutputParser已从langchain.schema迁移至langchain_core.output_parsers.base模块。

修复后的正确导入代码:

from langchain_core.output_parsers.base import BaseOutputParser

如果你的环境未安装langchain_core,执行以下命令安装:

pip install langchain-core

内容的提问来源于stack exchange,提问作者Sevval Kahraman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 10:27:09