Error while deploying my app

Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/", line 354, in _run_script
    exec(code, module.__dict__)
  File "/app/test/", line 4, in <module>
    from langchain.text_splitter import CharacterTextSplitter
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/", line 8, in <module>
    from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/agents/", line 2, in <module>
    from langchain.agents.agent import Agent
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/agents/", line 8, in <module>
    from langchain.chains.base import Chain
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/", line 2, in <module>
    from langchain.chains.conversation.base import ConversationChain
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/conversation/", line 7, in <module>
    from langchain.chains.conversation.memory import ConversationBufferMemory
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/conversation/", line 7, in <module>
    from langchain.chains.conversation.prompt import SUMMARY_PROMPT
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/conversation/", line 2, in <module>
    from langchain.prompts.prompt import PromptTemplate
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/prompts/", line 2, in <module>
    from langchain.prompts.base import BasePromptTemplate
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/prompts/", line 35, in <module>
    class BasePromptTemplate(BaseModel, ABC):
  File "/home/appuser/venv/lib/python3.9/site-packages/langchain/prompts/", line 41, in BasePromptTemplate
  File "/home/appuser/venv/lib/python3.9/site-packages/pydantic/deprecated/", line 228, in root_validator
    raise PydanticUserError(
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

Hi @abhijithjainn, and welcome to our forums! :raised_hands:

The error may come from the LangChain package, which is not compatible with your current Pydantic version due to a change in how Pydantic handles validation.

You can maybe try downgrading Pydantic to an earlier version, like 1.8, with pip install pydantic==1.8.

Let us know if that works! :slight_smile:



Hey thanks it worked, however i am facing another issue now.

ModuleNotFoundError: No module named ‘langchain.chains.question_answering’

I had this locally aswell, but then i uninstalled & reinstalled langchain & it worked. How to fix it here?

Is it working locally?

Yes it is working on my local host!

Potentially worth downgrading to an earlier version of Langchain, see if that solves the issue?


I tried downgrading, but it seems to be not working :frowning:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.