pythonspacy

Unable to install spacy on MacOS 15.5 (M2) with Python 3.13.3


Having created a new venv I am attempting to install spacy strictly in accordance with the documentation

Specifically:

pip install -U pip setuptools wheel
pip install -U 'spacy[apple]'

This fails (huge error output) that seems to stem from:

In file included from ../numpy/_core/src/umath/string_ufuncs.cpp:20:
            ../numpy/_core/src/umath/string_fastsearch.h:132:5: error: no type named 'ptrdiff_t' in namespace 'std'; did you mean simply 'ptrdiff_t'?

My guess is that the 2.2.6 version of numpy is incompatible but I can't find anything in spacy documentation to help me.

My Xcode environment is fully up-to-date.

I have seen other posts on Stackoverflow abut installation issues with spacy but they're rather old and some of the "solutions" are clearly ridiculous.


Solution

  • The issue is with the python version. spaCy is not yet compatible with python3.13. You need to use the python version <= 3.12