这是indexloc提供的服务,不要输入任何密码
Skip to content

AttributeError: module 'pydantic_core' has no attribute 'TuplePositionalSchema' #167

@maurosilber

Description

@maurosilber

Installing and running pydantic-xml on a new environment raises this error:

.../lib/python3.10/site-packages/pydantic_xml/serializers/factories/heterogeneous.py:14: in ElementSerializer
    def from_core_schema(cls, schema: pcs.TuplePositionalSchema, ctx: Serializer.Context) -> 'ElementSerializer':
.../lib/python3.10/site-packages/pydantic_core/core_schema.py:3974: in __getattr__
    raise AttributeError(f"module 'pydantic_core' has no attribute '{attr_name}'")
E   AttributeError: module 'pydantic_core' has no attribute 'TuplePositionalSchema'. Did you mean: 'tuple_positional_schema'?

They seem to have removed that class in this commit: pydantic/pydantic-core@4df7624

It works with pydantic_core < 2.16 and pedantic < 2.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2Version 2 related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions