ollama-python does not install on Python 3.14 beta 1 #266

Closed
opened 2026-02-15 16:29:21 -05:00 by yindo · 3 comments
Owner

Originally created by @craigahobbs on GitHub (May 8, 2025).

Repro:

macOS (building from source)

curl -O https://www.python.org/ftp/python/3.14.0/Python-3.14.0a7.tgz
tar xvzf Python-3.14.0a7.tgz
cd Python-3.14.0a7
./configure --prefix=$(pwd)/../python3.14 --with-openssl=$(brew --prefix openssl) --enable-optimizations
make
make install
cd ..
./python3.14/bin/python3 -m venv venv3.14 --upgrade-deps
. venv3.14/bin/activate
pip install ollama

Debian Bookworm (using podman on macOS)

podman run -i --rm  -v $HOME:$HOME -v `pwd`:`pwd` -w `pwd` -e HOME=$HOME python:3.14-rc python3 -m venv --upgrade-deps venv3.14
podman run -i --rm  -v $HOME:$HOME -v `pwd`:`pwd` -w `pwd` -e HOME=$HOME python:3.14-rc venv3.14/bin/python3 -m pip -q install ollama

Expected: Success
Actual: Failure

...
Collecting pydantic-core==2.33.2 (from pydantic<3.0.0,>=2.9.0->ollama)
  Downloading pydantic_core-2.33.2.tar.gz (435 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/

      Checking for Rust toolchain....
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

The above failure isn't directly ollama-python's, its pydantic's, but kills install nonetheless.

Originally created by @craigahobbs on GitHub (May 8, 2025). Repro: **macOS (building from source)** ``` curl -O https://www.python.org/ftp/python/3.14.0/Python-3.14.0a7.tgz tar xvzf Python-3.14.0a7.tgz cd Python-3.14.0a7 ./configure --prefix=$(pwd)/../python3.14 --with-openssl=$(brew --prefix openssl) --enable-optimizations make make install cd .. ./python3.14/bin/python3 -m venv venv3.14 --upgrade-deps . venv3.14/bin/activate pip install ollama ``` **Debian Bookworm (using podman on macOS)** ``` podman run -i --rm -v $HOME:$HOME -v `pwd`:`pwd` -w `pwd` -e HOME=$HOME python:3.14-rc python3 -m venv --upgrade-deps venv3.14 podman run -i --rm -v $HOME:$HOME -v `pwd`:`pwd` -w `pwd` -e HOME=$HOME python:3.14-rc venv3.14/bin/python3 -m pip -q install ollama ``` Expected: Success Actual: Failure ``` ... Collecting pydantic-core==2.33.2 (from pydantic<3.0.0,>=2.9.0->ollama) Downloading pydantic_core-2.33.2.tar.gz (435 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ``` The above failure isn't directly ollama-python's, its pydantic's, but kills install nonetheless.
yindo closed this issue 2026-02-15 16:29:21 -05:00
Author
Owner

@mxyng commented on GitHub (May 8, 2025):

As you've noted, the failure isn't in Ollama but in an upstream dependency. I suggest you create an issue there.

Python 3.14 is in early preview. The error you're seeing is due to pydantic trying and failing to build itself because there's no prebuilt package available. This is expected for new Python versions.

To build pydantic, you'll need to install the Rust toolchain cargo, as the error suggests.

@mxyng commented on GitHub (May 8, 2025): As you've noted, the failure isn't in Ollama but in an upstream dependency. I suggest you create an issue there. Python 3.14 is in early preview. The error you're seeing is due to pydantic trying and failing to build itself because there's no prebuilt package available. This is expected for new Python versions. To build pydantic, you'll need to install the Rust toolchain `cargo`, as the error suggests.
Author
Owner

@craigahobbs commented on GitHub (May 8, 2025):

I think it's important to point out that this will be a continual headache every year for projects that take a dependency on ollama-python as a result of its pydantic dependency, which is not great. Hope pydantic is giving you something good.

@craigahobbs commented on GitHub (May 8, 2025): I think it's important to point out that this will be a continual headache every year for projects that take a dependency on ollama-python as a result of its pydantic dependency, which is not great. Hope pydantic is giving you something good.
Author
Owner

@craigahobbs commented on GitHub (May 9, 2025):

@mxyng it's worse than you let on:

brew install rust maturin
pip install ollama

...
        --- stderr
        error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13)
        = help: please check if an updated version of PyO3 is available. Current version: 0.24.1
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      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 MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/Users/craighobbs/tmp/venv3.14/bin/python3" PYTHON_SYS_EXECUTABLE="/Users/craighobbs/tmp/venv3.14/bin/python3" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/5n/wqn5p9n9659ccf7ylrxc2hww0000gn/T/pip-install-cjoyg_tz/pydantic-core_90d34494ce534e229fdae3dfe0fe7802/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/pydantic_core._pydantic_core.cpython-314-darwin.so"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/craighobbs/tmp/venv3.14/bin/python3', '--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: Failed to build installable wheels for some pyproject.toml based projects (pydantic-core)

So, once you install Rust it fails the install because PYO3 doesn't support Python 3.14. When will it? When will Pydantic bless us with native packages? We can only wonder...

I strongly disagree that a Python beta is an "early preview". Python betas are feature complete. This is the time for package maintainers to start testing so that bugs can be reported to ensure a stable Python release for their package. Currently, ollama-python, and everyone dependent on it, is untestable on Python 3.14.

Pydantic, because of its pointless Rust dependency, is a harmful dependency that is causing pain now and will indefinitely.

@craigahobbs commented on GitHub (May 9, 2025): @mxyng it's worse than you let on: ``` brew install rust maturin pip install ollama ... --- stderr error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13) = help: please check if an updated version of PyO3 is available. Current version: 0.24.1 = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI 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 MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/Users/craighobbs/tmp/venv3.14/bin/python3" PYTHON_SYS_EXECUTABLE="/Users/craighobbs/tmp/venv3.14/bin/python3" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/5n/wqn5p9n9659ccf7ylrxc2hww0000gn/T/pip-install-cjoyg_tz/pydantic-core_90d34494ce534e229fdae3dfe0fe7802/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/pydantic_core._pydantic_core.cpython-314-darwin.so"` Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/craighobbs/tmp/venv3.14/bin/python3', '--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: Failed to build installable wheels for some pyproject.toml based projects (pydantic-core) ``` So, once you install Rust it fails the install because PYO3 doesn't support Python 3.14. When will it? When will Pydantic bless us with native packages? We can only wonder... I strongly disagree that a Python beta is an "early preview". Python betas are feature complete. This is the time for package maintainers to start testing so that bugs can be reported to ensure a stable Python release for their package. Currently, ollama-python, and everyone dependent on it, is untestable on Python 3.14. Pydantic, because of its pointless Rust dependency, is a harmful dependency that is causing pain now and will indefinitely.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#266