Skip to content

Installing spacy-curated-transformers causes thinc build failure #13984

Description

@workflowsguy
pip install spacy-curated-transformers

gives

Defaulting to user installation because normal site-packages is not writeable
Collecting spacy-curated-transformers
  Downloading spacy_curated_transformers-2.1.2-py2.py3-none-any.whl.metadata (2.8 kB)
Collecting curated-transformers<3.0.0,>=2.0.0 (from spacy-curated-transformers)
  Downloading curated_transformers-2.0.1-py2.py3-none-any.whl.metadata (5.3 kB)
Requirement already satisfied: curated-tokenizers<3.0.0,>=2.0.0 in /Users/guy/Library/Python/3.13/lib/python/site-packages (from spacy-curated-transformers) (2.0.0)
Requirement already satisfied: fsspec>=2023.5.0 in /Users/guy/Library/Python/3.13/lib/python/site-packages (from spacy-curated-transformers) (2026.4.0)
Collecting thinc<9.2.0,>=9.0.0.dev4 (from spacy-curated-transformers)
  Downloading thinc-9.1.1.tar.gz (191 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      #
      # See __init__.cython-30.pxd for the real Cython header
      #

      # intentionally created compiler error that only triggers on Cython < 3.0.0
      DEF err = int('Build aborted: the NumPy Cython headers require Cython 3.0.0 or newer.')
                  ^
      ------------------------------------------------------------

      /private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/numpy/__init__.pxd:12:13: Error in compile-time expression: ValueError: invalid literal for int() with base 10: 'Build aborted: the NumPy Cython headers require Cython 3.0.0 or newer.'


      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      from libc.stdint cimport uintptr_t

      import numpy


      cpdef np.ndarray gemm(float[:, ::1] A, float[:, ::1] B,
           ^
      ------------------------------------------------------------

      thinc/backends/_accelerate.pyx:7:6: 'ndarray' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      import numpy


      cpdef np.ndarray gemm(float[:, ::1] A, float[:, ::1] B,
                            bint trans1=False, bint trans2=False,
                            np.ndarray out=None):
                           ^
      ------------------------------------------------------------

      thinc/backends/_accelerate.pyx:9:22: 'ndarray' is not a type identifier
      Cythonizing sources
      Compiling thinc/backends/cblas.pyx because it changed.
      Compiling thinc/backends/numpy_ops.pyx because it changed.
      Compiling thinc/layers/sparselinear.pyx because it changed.
      Compiling thinc/layers/premap_ids.pyx because it changed.
      Compiling thinc/backends/apple_ops.pyx because it changed.
      Compiling thinc/backends/_accelerate.pyx because it changed.
      [1/6] Cythonizing thinc/backends/_accelerate.pyx
      Traceback (most recent call last):
        File "/Users/guy/Library/Python/3.13/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/guy/Library/Python/3.13/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/guy/Library/Python/3.13/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 111, in <module>
        File "<string>", line 96, in setup_package
        File "/private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize
          cythonize_one(*args)
          ~~~~~~~~~~~~~^^^^^^^
        File "/private/var/folders/wg/gl7rmcbs7g39kj9kr5m6_dpm0000gn/T/pip-build-env-c_1gxxch/overlay/lib/python3.13/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: thinc/backends/_accelerate.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'thinc' when getting requirements to build wheel

How to reproduce the behaviour

see above

Your Environment

Operating System: macOS 15.7.7 (arm64)
Python Version Used: 3.13.14
spaCy Version Used: 3.8.14
Environment Information: ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions