Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Tantivy using PIP on Mac Silicon #442

Closed
GratefulDave opened this issue Mar 7, 2025 · 2 comments
Closed

Unable to install Tantivy using PIP on Mac Silicon #442

GratefulDave opened this issue Mar 7, 2025 · 2 comments
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed maintainers

Comments

@GratefulDave
Copy link

Describe the bug

  • Cloned agno-agi repo. Installed via pip.
  • pip install tantivy
  Using cached tantivy-0.22.0.tar.gz (60 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tantivy
  Building wheel for tantivy (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for tantivy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [146 lines of output]
      Running `maturin pep517 build-wheel -i /Users/davidandrews/PycharmProjects/agno/.venv/bin/python --compatibility off`
      📦 Including license file "/private/var/folders/xx/tqlb57s53hx1dffm7klfzkvm0000gn/T/pip-install-acu_kki8/tantivy_cfa78a13b2dc43d2b5faa3b8355a0f4b/LICENSE"
      🍹 Building a mixed python/rust project
      🔗 Found pyo3 bindings
      🐍 Found CPython 3.13 at /Users/davidandrews/PycharmProjects/agno/.venv/bin/python
      📡 Using build options bindings from pyproject.toml
      💻 Using `MACOSX_DEPLOYMENT_TARGET=11.0` for aarch64-apple-darwin by default
         Compiling autocfg v1.1.0
         Compiling proc-macro2 v1.0.69
         Compiling unicode-ident v1.0.12
         Compiling cfg-if v1.0.0
         Compiling libc v0.2.153
         Compiling serde v1.0.190
         Compiling target-lexicon v0.12.12
         Compiling libm v0.2.8
         Compiling once_cell v1.18.0
         Compiling pkg-config v0.3.27
         Compiling scopeguard v1.2.0
         Compiling crossbeam-utils v0.8.16
         Compiling memchr v2.6.4
         Compiling num-traits v0.2.17
         Compiling memoffset v0.9.0
         Compiling crunchy v0.2.2
         Compiling async-trait v0.1.74
         Compiling itoa v1.0.9
         Compiling powerfmt v0.2.0
         Compiling quote v1.0.33
         Compiling syn v2.0.38
         Compiling crossbeam-epoch v0.9.15
         Compiling jobserver v0.1.27
         Compiling pyo3-build-config v0.20.0
         Compiling cc v1.0.83
         Compiling getrandom v0.2.10
         Compiling rand_core v0.6.4
         Compiling futures-core v0.3.29
         Compiling version_check v0.9.4
         Compiling zstd-safe v7.1.0
         Compiling regex-syntax v0.8.2
         Compiling ppv-lite86 v0.2.17
         Compiling stable_deref_trait v1.2.0
         Compiling byteorder v1.5.0
         Compiling time-core v0.1.2
         Compiling ownedbytes v0.7.0
         Compiling rand_chacha v0.3.1
         Compiling ahash v0.8.6
         Compiling slab v0.4.9
         Compiling zstd-sys v2.0.10+zstd.1.5.6
         Compiling lock_api v0.4.11
         Compiling futures-channel v0.3.29
         Compiling rustix v0.38.21
         Compiling smallvec v1.11.1
         Compiling futures-task v0.3.29
         Compiling parking_lot_core v0.9.9
         Compiling pyo3-ffi v0.20.0
         Compiling rand v0.8.5
         Compiling bitpacking v0.9.2
         Compiling errno v0.3.5
         Compiling rayon-core v1.12.0
         Compiling bitflags v2.4.1
         Compiling zerocopy v0.7.31
         Compiling either v1.9.0
         Compiling core-foundation-sys v0.8.4
         Compiling futures-util v0.3.29
         Compiling utf8-ranges v1.0.5
         Compiling futures-sink v0.3.29
         Compiling heck v0.4.1
         Compiling pyo3-macros-backend v0.20.0
         Compiling tantivy-fst v0.5.0
         Compiling iana-time-zone v0.1.58
         Compiling rand_distr v0.4.3
         Compiling serde_derive v1.0.190
         Compiling futures-macro v0.3.29
         Compiling pyo3 v0.20.0
         Compiling crossbeam-deque v0.8.3
         Compiling crc32fast v1.3.2
         Compiling futures-io v0.3.29
         Compiling allocator-api2 v0.2.16
         Compiling minimal-lexical v0.2.1
         Compiling murmurhash32 v0.3.0
         Compiling thiserror v1.0.50
         Compiling serde_json v1.0.109
         Compiling pin-utils v0.1.0
         Compiling pin-project-lite v0.2.13
         Compiling hashbrown v0.14.2
         Compiling nom v7.1.3
         Compiling pyo3-macros v0.20.0
         Compiling thiserror-impl v1.0.50
         Compiling parking_lot v0.12.1
         Compiling chrono v0.4.38
         Compiling itertools v0.12.1
         Compiling regex-automata v0.4.3
         Compiling instant v0.1.12
         Compiling fastdivide v0.4.0
         Compiling downcast-rs v1.2.0
         Compiling ryu v1.0.15
         Compiling fastrand v2.0.1
         Compiling unindent v0.2.3
         Compiling indoc v2.0.4
         Compiling log v0.4.20
         Compiling tempfile v3.8.1
         Compiling futures-executor v0.3.29
         Compiling measure_time v0.8.2
         Compiling tantivy-query-grammar v0.22.0
         Compiling rayon v1.8.0
         Compiling lru v0.12.3
         Compiling fs4 v0.8.2
         Compiling tantivy v0.22.0 (/private/var/folders/xx/tqlb57s53hx1dffm7klfzkvm0000gn/T/pip-install-acu_kki8/tantivy_cfa78a13b2dc43d2b5faa3b8355a0f4b)
         Compiling crossbeam-channel v0.5.8
         Compiling regex v1.10.2
         Compiling memmap2 v0.9.4
         Compiling num_cpus v1.16.0
         Compiling aho-corasick v1.1.2
         Compiling levenshtein_automata v0.2.1
         Compiling deranged v0.3.9
         Compiling uuid v1.5.0
         Compiling sketches-ddsketch v0.2.1
         Compiling time v0.3.30
         Compiling rust-stemmers v1.2.0
         Compiling tantivy-tokenizer-api v0.3.0
         Compiling fnv v1.0.7
         Compiling census v0.4.2
         Compiling lz4_flex v0.11.1
         Compiling oneshot v0.1.6
      error[E0282]: type annotations needed for `Box<_>`
        --> /Users/davidandrews/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.30/src/format_description/parse/mod.rs:83:9
         |
      83 |     let items = format_items
         |         ^^^^^
      ...
      86 |     Ok(items.into())
         |              ---- type must be known at this point
         |
         = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`
      
         Compiling arc-swap v1.6.0
         Compiling rustc-hash v1.1.0
         Compiling tantivy-bitpacker v0.6.0
         Compiling htmlescape v0.3.1
         Compiling base64 v0.22.1
      For more information about this error, try `rustc --explain E0282`.
      error: could not compile `time` (lib) due to 1 previous error
      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": `MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.13-64bit" PYO3_PYTHON="/Users/davidandrews/PycharmProjects/agno/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/Users/davidandrews/PycharmProjects/agno/.venv/bin/python" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/xx/tqlb57s53hx1dffm7klfzkvm0000gn/T/pip-install-acu_kki8/tantivy_cfa78a13b2dc43d2b5faa3b8355a0f4b/Cargo.toml" "--release" "--lib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/tantivy.cpython-313-darwin.so"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/davidandrews/PycharmProjects/agno/.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 tantivy
Failed to build tantivy
ERROR: Failed to build installable wheels for some pyproject.toml based projects (tantivy)

What was expected?

An easy installation.

Which version of tantivy are you using?

See below

To Reproduce

git clone https://github.com/agno-agi/agno.git
pip install -U agno openai duckduckgo-search lancedb pypdf yfinance
pip install -U tantivy

Cargo.toml

name = "tantivy"
version = "0.22.0"
readme = "README.md"
authors = ["Damir Jelić <poljar@termina.org.uk>"]
edition = "2021"
license = "MIT"

[lib]
name = "tantivy"
crate-type = ["cdylib"]

[build-dependencies]
pyo3-build-config = "*"

[dependencies]
base64 = "0.22"
chrono = "0.4.38"
tantivy = "0.22.0"
itertools = "0.12.1"
futures = "0.3.26"
pythonize = "0.20.0"
serde = "1.0"
serde_json = "1.0.109"

[dependencies.pyo3]
version = "0.20.0"
features = ["chrono", "extension-module"]

What did I try?

Tried updating cargo pyproject.toml using advice from Gemini.

System:

  • Mac M1, 64GB, Sequoia 15.3.1 (24D70)
  • Python 3.13.2
@cjrh
Copy link
Collaborator

cjrh commented Mar 7, 2025

We don't yet support Python 3.13. This is a known issue. We have wheels for mac but only up to 3.12: https://pypi.org/project/tantivy/#files

The work to support 3.13 is being tracked here: #371
But it depends on being able to upgrade the pythonize and pyo3 packages, which is being worked on in #401.

@GratefulDave
Copy link
Author

Thank you, I will downgrade to 3.12.

@cjrh cjrh added help wanted Extra attention is needed dependencies Pull requests that update a dependency file maintainers labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed maintainers
Projects
None yet
Development

No branches or pull requests

2 participants