pydantic.errors.PydanticUserError: If you use `@root_validator`

报错

使用langchain时,import langchain时报错内容如下:

pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.
 
For further information visit https://errors.pydantic.dev/2.7/u/root-validator-pre-skip

解决

pydantic的版本问题,将pydantic库的版本降低到1.10.13,pydantic_core等相关依赖库的版本也会自动降低。

pip install pydantic==1.10.13 -i  https://pypi.tuna.tsinghua.edu.cn/simple

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-11 02:48:05       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-11 02:48:05       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-11 02:48:05       87 阅读
  4. Python语言-面向对象

    2024-06-11 02:48:05       96 阅读

热门阅读

  1. 如何在Linux中使用Screen管理后台进程

    2024-06-11 02:48:05       32 阅读
  2. 用c#开发在linux环境下运行的程序

    2024-06-11 02:48:05       30 阅读
  3. 抖音商家电话采集软件 抖音小店信息采集

    2024-06-11 02:48:05       31 阅读
  4. 如何将多个jtl文件合并到一个,并且生成html报告

    2024-06-11 02:48:05       26 阅读
  5. 十四、OpenAI之助手API(Asistants API)

    2024-06-11 02:48:05       29 阅读
  6. debugger(三):dwarf 文件

    2024-06-11 02:48:05       32 阅读
  7. Python3 笔记:字符串的 zfill() 和 rjust()

    2024-06-11 02:48:05       36 阅读
  8. 中国自研的AI算力基建和服务的发展

    2024-06-11 02:48:05       37 阅读
  9. 设计模式七大原则-接口隔离原则InterfaceSegregation

    2024-06-11 02:48:05       36 阅读
  10. 单片机中的四种通信总线:UART、I2C、SPI、CAN

    2024-06-11 02:48:05       30 阅读
  11. c++手写的bitset

    2024-06-11 02:48:05       26 阅读
  12. 【系统学C++】二、从C语言到C++(二)

    2024-06-11 02:48:05       30 阅读