Skip to content

Failed building wheel for pydantic-core #307

Open
@rabin-io

Description

@rabin-io

When running from source with python venv, the requirements installation fails with

...
         Compiling ryu v1.0.14
         Compiling url v2.4.1
      error: failed to run custom build command for `pydantic-core v2.14.5 (/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f)`

      Caused by:
        process didn't exit successfully: `/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/target/release/build/pydantic-core-9337f5da33746ae1/build-script-build` (exit status: 101)
        --- stdout
        cargo:rustc-cfg=Py_3_6
        cargo:rustc-cfg=Py_3_7
        cargo:rustc-cfg=Py_3_8
        cargo:rustc-cfg=Py_3_9
        cargo:rustc-cfg=Py_3_10
        cargo:rustc-cfg=Py_3_11
        cargo:rustc-cfg=Py_3_12
        cargo:rustc-cfg=Py_3_13
        cargo:rerun-if-changed=python/pydantic_core/core_schema.py
        cargo:rerun-if-changed=generate_self_schema.py

        --- stderr
        Traceback (most recent call last):
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 192, in eval_forward_ref
            return type_._evaluate(core_schema.__dict__, None, set())
                   ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 240, in <module>
            main()
            ~~~~^^
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 210, in main
            value = get_schema(s, definitions)
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 54, in get_schema
            return type_dict_schema(obj, definitions)
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 152, in type_dict_schema
            field_type = eval_forward_ref(field_type)
          File "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/generate_self_schema.py", line 195, in eval_forward_ref
            return type_._evaluate(core_schema.__dict__, None)
                   ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
        thread 'main' panicked at build.rs:29:9:
        generate_self_schema.py failed with exit status: 1
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.13-64bit" PYO3_PYTHON="/mnt/data/src/Tasmota-Device-Manager/venv/bin/python" PYTHON_SYS_EXECUTABLE="/mnt/data/src/Tasmota-Device-Manager/venv/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-b5vc2ac_/pydantic-core_206942d230b04fd198db7a77a33b901f/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/mnt/data/src/Tasmota-Device-Manager/venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pydantic-core
Failed to build pydantic-core
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pydantic-core)

This was reported and fixed here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions