Cannot install latest transformers version 4.57.0 in free-threaded python version 3.14
Author: fleonce
Pull request: no
Labels: name: bug

### System Info

On Debian 12 with 

`Python 3.14.0rc3 free-threading build (main, Oct  3 2025, 22:25:41) [GCC 12.2.0]`

the following command fails: `pip install transformers`, since hf-xet cannot be installed due to the following error:

```
Building wheels for collected packages: hf-xet
  Building wheel for hf-xet (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for hf-xet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [263 lines of output]
      Running `maturin pep517 build-wheel -i /home/x/.threaded/bin/python --compatibility off`
      Python reports SOABI: cpython-314t-x86_64-linux-gnu
      Computed rustc target triple: x86_64-unknown-linux-gnu
      Installation directory: /home/x/.cache/puccinialin
      Rustup already downloaded
      Installing rust to /home/x/.cache/puccinialin/rustup
      warn: It looks like you have an existing rustup settings file at:
      warn: /home/x/.rustup/settings.toml
      warn: Rustup will install the default toolchain as specified in the settings file,
      warn: instead of the one inferred from the default host triple.
      info: profile set to 'minimal'
      info: default host triple is x86_64-unknown-linux-gnu
      warn: Updating existing toolchain, profile choice will be ignored
      info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
      info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'
      Checking if cargo is installed
      cargo 1.90.0 (840b83a10 2025-07-30)
      ⚠️ Warning: You specified the python source as /tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/hf_xet/python, but the python module at /tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/hf_xet/python/hf_xet is missing. No python module will be included.
      🔗 Found pyo3 bindings with abi3 support
      🐍 Not using a specific python interpreter
      📡 Using build options features from pyproject.toml
      ⚠️ Warning: CPython 3.14t at /home/x/.threaded/bin/python does not yet support abi3 so the build artifacts will be version-specific.
         Compiling proc-macro2 v1.0.101
         Compiling unicode-ident v1.0.18
         Compiling libc v0.2.175
         Compiling cfg-if v1.0.1
         Compiling shlex v1.3.0
         Compiling memchr v2.7.5
         Compiling itoa v1.0.15
         Compiling once_cell v1.21.3
         Compiling pin-project-lite v0.2.16
         Compiling serde v1.0.219
         Compiling bytes v1.10.1
         Compiling futures-core v0.3.31
         Compiling zerocopy v0.8.26
         Compiling futures-sink v0.3.31
         Compiling cc v1.2.33
         Compiling ryu v1.0.20
         Compiling serde_json v1.0.142
         Compiling tracing-core v0.1.34
         Compiling futures-channel v0.3.31
         Compiling pin-utils v0.1.0
         Compiling futures-io v0.3.31
         Compiling getrandom v0.3.3
         Compiling futures-task v0.3.31
         Compiling stable_deref_trait v1.2.0
         Compiling slab v0.4.11
         Compiling crossbeam-utils v0.8.21
         Compiling smallvec v1.15.1
         Compiling base64 v0.22.1
         Compiling autocfg v1.5.0
         Compiling thiserror v2.0.15
         Compiling lazy_static v1.5.0
         Compiling pkg-config v0.3.32
         Compiling option-ext v0.2.0
         Compiling target-lexicon v0.12.16
         Compiling fnv v1.0.7
         Compiling litemap v0.8.0
         Compiling byteorder v1.5.0
         Compiling writeable v0.6.1
         Compiling zeroize v1.8.1
         Compiling bytemuck v1.23.2
         Compiling quote v1.0.40
         Compiling crossbeam-queue v0.3.12
         Compiling heed-traits v0.8.0
         Compiling rustls-pki-types v1.12.0
         Compiling http v1.3.1
         Compiling syn v2.0.106
         Compiling mio v1.0.4
         Compiling socket2 v0.6.0
         Compiling getrandom v0.2.16
         Compiling synchronoise v1.0.1
         Compiling page_size v0.4.2
         Compiling rand_core v0.9.3
         Compiling untrusted v0.9.0
         Compiling icu_normalizer_data v2.0.0
         Compiling constant_time_eq v0.3.1
         Compiling arrayref v0.3.9
         Compiling icu_properties_data v2.0.1
         Compiling syn v1.0.109
         Compiling bitflags v2.9.2
         Compiling arrayvec v0.7.6
         Compiling pyo3-build-config v0.23.5
         Compiling dirs-sys v0.5.0
         Compiling ring v0.17.14
         Compiling lmdb-rkv-sys v0.11.2
         Compiling blake3 v1.8.2
         Compiling anstyle v1.0.11
         Compiling httparse v1.10.1
         Compiling percent-encoding v2.3.1
         Compiling safe-transmute v0.11.3
         Compiling http-body v1.0.1
         Compiling dtor-proc-macro v0.0.5
         Compiling dirs v6.0.0
         Compiling thiserror v1.0.69
         Compiling dtor v0.0.6
         Compiling ppv-lite86 v0.2.21
         Compiling heck v0.5.0
         Compiling ctor-proc-macro v0.0.6
         Compiling rustls v0.23.31
         Compiling try-lock v0.2.5
         Compiling tower-service v0.3.3
         Compiling want v0.3.1
         Compiling shellexpand v3.1.1
         Compiling ctor v0.4.3
         Compiling aho-corasick v1.1.3
         Compiling anyhow v1.0.99
         Compiling subtle v2.6.1
         Compiling rand_chacha v0.9.0
         Compiling log v0.4.27
         Compiling regex-syntax v0.8.5
         Compiling rand v0.9.2
         Compiling atomic-waker v1.1.2
         Compiling utf8parse v0.2.2
         Compiling anstyle-parse v0.2.7
         Compiling form_urlencoded v1.2.1
         Compiling sync_wrapper v1.0.2
         Compiling anstyle-query v1.1.4
         Compiling ipnet v2.11.0
         Compiling rustix v1.0.8
         Compiling utf8_iter v1.0.4
         Compiling colorchoice v1.0.4
         Compiling is_terminal_polyfill v1.70.1
         Compiling tower-layer v0.3.3
         Compiling openssl-probe v0.1.6
         Compiling anstream v0.6.20
         Compiling rustls-native-certs v0.8.1
         Compiling webpki-roots v1.0.2
         Compiling rand_core v0.6.4
         Compiling num-traits v0.2.19
         Compiling iri-string v0.7.8
         Compiling linux-raw-sys v0.9.4
         Compiling typenum v1.18.0
         Compiling strsim v0.11.1
         Compiling clap_lex v0.7.5
         Compiling version_check v0.9.5
         Compiling clap_builder v4.5.44
         Compiling generic-array v0.14.7
         Compiling rand_chacha v0.3.1
         Compiling http-body-util v0.1.3
         Compiling fastrand v2.3.0
         Compiling either v1.15.0
         Compiling predicates-core v1.0.9
         Compiling regex-automata v0.4.9
         Compiling mockall_derive v0.13.1
         Compiling itertools v0.14.0
         Compiling rand v0.8.5
         Compiling derivative v2.2.0
         Compiling synstructure v0.13.2
         Compiling tempfile v3.20.0
         Compiling uuid v1.18.0
         Compiling cfg-if v0.1.10
         Compiling static_assertions v1.1.0
         Compiling heapify v0.2.0
         Compiling time-core v0.1.4
         Compiling num-conv v0.1.0
         Compiling powerfmt v0.2.0
         Compiling termtree v0.5.1
         Compiling crc32fast v1.5.0
         Compiling more-asserts v0.3.1
         Compiling time-macros v0.2.22
         Compiling deranged v0.4.0
         Compiling predicates-tree v1.0.12
         Compiling gearhash v0.1.3
         Compiling predicates v3.1.3
         Compiling lock_api v0.4.13
         Compiling colored v2.2.0
         Compiling csv-core v0.1.12
         Compiling downcast v0.11.0
         Compiling serde_derive v1.0.219
         Compiling tokio-macros v2.5.0
         Compiling zerofrom-derive v0.1.6
         Compiling tracing-attributes v0.1.30
         Compiling yoke-derive v0.8.0
         Compiling futures-macro v0.3.31
         Compiling zerovec-derive v0.11.1
         Compiling displaydoc v0.2.5
         Compiling tokio v1.47.1
         Compiling thiserror-impl v2.0.15
         Compiling async-trait v0.1.89
         Compiling futures-util v0.3.31
         Compiling pin-project-internal v1.1.10
         Compiling rustls-webpki v0.103.4
         Compiling tracing v0.1.41
         Compiling zerofrom v0.1.6
         Compiling yoke v0.8.0
         Compiling error_printer v0.14.5 (/tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/error_printer)
         Compiling thiserror-impl v1.0.69
         Compiling zerovec v0.11.4
         Compiling zerotrie v0.2.2
         Compiling regex v1.11.1
         Compiling clap_derive v4.5.45
         Compiling pin-project v1.1.10
         Compiling serde_repr v0.1.20
         Compiling tinystr v0.8.1
         Compiling potential_utf v0.1.2
         Compiling icu_collections v2.0.0
         Compiling whoami v1.6.1
         Compiling icu_locale_core v2.0.0
         Compiling fragile v2.0.1
         Compiling twox-hash v2.1.1
         Compiling parking_lot_core v0.9.11
         Compiling lz4_flex v0.11.5
         Compiling time v0.3.41
         Compiling file_utils v0.14.2 (/tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/file_utils)
         Compiling icu_provider v2.0.0
         Compiling futures-executor v0.3.31
         Compiling num-integer v0.1.46
         Compiling retry-policies v0.4.0
         Compiling futures v0.3.31
         Compiling icu_properties v2.0.1
         Compiling icu_normalizer v2.0.0
         Compiling pyo3-macros-backend v0.23.5
         Compiling pyo3-ffi v0.23.5
         Compiling sha2-asm v0.6.4
         Compiling countio v0.2.19
         Compiling clap v4.5.45
         Compiling half v2.6.0
         Compiling regex-syntax v0.6.29
         Compiling oneshot v0.1.11
         Compiling scopeguard v1.2.0
         Compiling protobuf v3.7.2
         Compiling num-bigint v0.4.6
      error: failed to run custom build command for `pyo3-ffi v0.23.5`
      
      Caused by:
        process didn't exit successfully: `/tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/hf_xet/target/release/build/pyo3-ffi-f89ed39e89227bf3/build-script-build` (exit status: 1)
        --- stdout
        cargo:rustc-check-cfg=cfg(Py_LIMITED_API)
        cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)
        cargo:rustc-check-cfg=cfg(PyPy)
        cargo:rustc-check-cfg=cfg(GraalPy)
        cargo:rustc-check-cfg=cfg(py_sys_config, values("Py_DEBUG", "Py_REF_DEBUG", "Py_TRACE_REFS", "COUNT_ALLOCS"))
        cargo:rustc-check-cfg=cfg(invalid_from_utf8_lint)
        cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)
        cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)
        cargo:rustc-check-cfg=cfg(diagnostic_namespace)
        cargo:rustc-check-cfg=cfg(c_str_lit)
        cargo:rustc-check-cfg=cfg(rustc_has_once_lock)
        cargo:rustc-check-cfg=cfg(fn_ptr_eq)
        cargo:rustc-check-cfg=cfg(Py_3_7)
        cargo:rustc-check-cfg=cfg(Py_3_8)
        cargo:rustc-check-cfg=cfg(Py_3_9)
        cargo:rustc-check-cfg=cfg(Py_3_10)
        cargo:rustc-check-cfg=cfg(Py_3_11)
        cargo:rustc-check-cfg=cfg(Py_3_12)
        cargo:rustc-check-cfg=cfg(Py_3_13)
        cargo:rerun-if-env-changed=PYO3_CROSS
        cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
        cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
      
        --- 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.23.5
        = help: The free-threaded build of CPython does not support the limited API so this check cannot be suppressed.
      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_BUILD_EXTENSION_MODULE="1" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/home/x/.threaded/bin/python" PYTHON_SYS_EXECUTABLE="/home/x/.threaded/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-haqniebn/hf-xet_cf9de919019944f9af86b1a64876b431/hf_xet/Cargo.toml" "--release" "--lib"`
      Rust not found, installing into a temporary directory
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/home/x/.threaded/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 hf-xet
Failed to build hf-xet
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> hf-xet
```

apparently, supporting this is current not planned (?) https://github.com/huggingface/xet-core/issues/512

Current fallback is installing older versions of huggingface_hub and transformers to bypass this issue (f.e. transformers 4.49.0, huggingface_hub 0.31.4)

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Steps to reproduce the issue:

1. Setup a new virtual environment with Python 3.14 via `python3.14t -m venv .venv`
2. Install latest transformers via `.venv/bin/pip install transformers`

### Expected behavior

Install should just work (?)

Comments:
i can work on this 


This is currently waiting on https://github.com/huggingface/xet-core/issues/512 to be resolved! After that we'll see if there are any other blockers for Transformers

Hi @fleonce  I’d love to contribute to this issue for Hacktoberfest. Could you please assign it to me?

Hey, since the `xet-core` fix has been merged, this should work now! Are people able to install on 3.14T, or do we need to bump our version of `xet-core` in the transformers dependencies?

Im not sure whether this fix as standalone suffices to enable installs on 3.14T, I'm getting another different error on my 3.14t pre-release candidate build. I'll quickly build 3.14T and respond with information based on the major release build

I got the same new error on a clean 3.14T build, I submitted my build error log to the xet-core issue

To install `hf-xet` directly from the xet-core repo, please run the following:

```
pip install "hf-xet @ git+https://github.com/huggingface/xet-core@main"
```

We are still testing to see if `hf-xet` works as expected in free-threaded python 3.14. We hope to have this released in the next week or so. Would love your help in testing out hf-xet with free-threaded python!

Seems like the `xet-core` fix has been merged but not included in a release, so we may have to wait on that!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

The xet-core fix should be released now, has anyone tried installing with 3.14T?

> The xet-core fix should be released now, has anyone tried installing with 3.14T?

Hey, @Rocketknight1. I've just tried with 3.14T and it's working now! So, i think issue can be marked as completed.

<img width="1854" height="1069" alt="Image" src="https://github.com/user-attachments/assets/00181861-4238-48b5-8b1c-0a82e38e7fbc" />

Nice! Closing for now, but I expect there might be more free-threading bugs in future. If people encounter them, make a new issue and ping me.