pydantic-core icon indicating copy to clipboard operation
pydantic-core copied to clipboard

Failed to install pydantic-core from sources

Open n-bes opened this issue 1 year ago • 11 comments

pydantic-core build script ignores virtual-enviroment:

$ pip3 install typing-extensions
Requirement already satisfied: typing-extensions in /venv/lib/python3.11/site-packages (4.12.2)

$ poetry install -v --no-root
...
     Compiling pydantic-core v2.20.0 (/tmp/tmp556rg92p/pydantic_core-2.20.0)
  error: failed to run custom build command for `pydantic-core v2.20.0 (/tmp/tmp556rg92p/pydantic_core-2.20.0)`

  Caused by:
    process didn't exit successfully: `/tmp/tmp556rg92p/pydantic_core-2.20.0/target/release/build/pydantic-core-e9fa49663ca28b67/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: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/tmp556rg92p/pydantic_core-2.20.0/generate_self_schema.py", line 19, in <module>
        from typing_extensions import TypedDict, get_args, get_origin, is_typeddict
    ModuleNotFoundError: No module named 'typing_extensions'
    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.11-64bit" PYO3_PYTHON="/usr/bin/python3.11" PYTHON_SYS_EXECUTABLE="/usr/bin/python3.11" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/tmp556rg92p/pydantic_core-2.20.0/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`

Related issues:

  • https://github.com/pydantic/pydantic/issues/9773
  • https://github.com/python-poetry/poetry/issues/9518

n-bes avatar Jul 01 '24 06:07 n-bes