spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Numpy 2.0 update causing issues with other software

Open Josh-XT opened this issue 1 year ago • 5 comments

Forcing numpy to 2.0+ forces breaking changes on other software. Unless it is absolutely required to use 2.0+, can this be reverted?

https://github.com/explosion/spaCy/commit/184e508d9c8db6fc89c60e5ec8e94324817259c9

Josh-XT avatar Oct 18 '24 18:10 Josh-XT

Yes, also numpy 2.0.0 requires python 3.9. Then, the line numpy>=2.0.0; python_version < "3.9" leads to a bug.

rphellan avatar Oct 19 '24 01:10 rphellan

Yes it is creating issue. I am facing issue while working with keyphrase-vectorizers==0.0.10 where it is using spacy version >=3.0.0 and it is installing spacy==3.8.2 i'm using python3.8 with numpy==1.24.3 which is compatable but spacy3.8.2 is looking for numpy2.0+ and that is not compatable with python3.8.

Darshan2104 avatar Oct 24 '24 06:10 Darshan2104

adding fasttext to the list of libs not compatible (and unfortunately also not maintained). we have found it to be the best language detection for shorter text.

lsmith77 avatar Oct 25 '24 15:10 lsmith77

@lsmith77 off-topic but I uploaded a numpy2 version of fasttext, because I ran into the same problem, and it was just a one line fix. see https://pypi.org/project/fasttext-numpy2/

simon-ging avatar Nov 07 '24 22:11 simon-ging

There's no way to support both numpy v1 and numpy v2 in the same release. You'll need to pin your spaCy dependency to have an upper-bound that uses numpy v1.

honnibal avatar Dec 10 '24 16:12 honnibal

This should be resolved now. numpy v2 is specified as a build-time dependency, while runtime is compatible with both.

honnibal avatar Nov 04 '25 14:11 honnibal