pydanticllama-indexpydantic-v2

AttributeError: module 'pydantic_core' has no attribute 'tuple_schema'


while importing pydantic v2+ using code:

from llama_index.core import SimpleDirectoryReader

I am getting this error:

AttributeError: module 'pydantic_core' has no attribute 'tuple_schema'
SysConfig:
{'platform': 'Darwin',
 'platform-release': '22.6.0',
 'platform-version': 'Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:52 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8103',
 'architecture': 'arm64',
 'hostname': 'Air-di-W----.----.box',
 'ip-address': '1-2.168.---.91',
 'mac-address': '--:9d:--:cd:db:1c',
 'processor': 'arm',
 'ram': '8 GB'}

Solution

  • !pip install pydantic==2.7.0
    !pip install pydantic_core==2.18.1
    

    I tested out the compatible versions and found the combination that works!