Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacy,Numpy,Thinc incompatibility #2232

Open
1 task done
0xtunafresh opened this issue Nov 29, 2024 · 2 comments
Open
1 task done

Spacy,Numpy,Thinc incompatibility #2232

0xtunafresh opened this issue Nov 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@0xtunafresh
Copy link

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Desribe the bug

I want to use spacy.load('xx-ent-wiki-sm') but

I got error "File "thinc/backends/numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject"

pip list :
thinc : 8.1.8
numpy :1.26.4
spacy:3.6.0

python : 3.9

Reproduction

nlp = spacy.load('xx-ent-wiki-sm')

BERTopic Version


@0xtunafresh 0xtunafresh added the bug Something isn't working label Nov 29, 2024
@jsjtadie
Copy link

Compatibility issues among Spacy, Numpy, and Thinc can arise due to different version requirements.

Spacy depends on specific versions of Numpy and Thinc for proper functionality. For example, if an older version of Spacy is used with a newer version of Numpy that has introduced breaking changes in its API, it may lead to errors such as function signature mismatches or unexpected behavior in mathematical operations that Spacy relies on.

Similarly, Thinc has its own dependencies and compatibility constraints with the other two. If the versions are not in harmony, issues like module import failures, segmentation faults during runtime, or incorrect results in neural - network - related computations (if applicable) might occur. It's crucial to ensure that the versions of Spacy, Numpy, and Thinc are carefully selected to work well together, usually by referring to the official documentation of each library for their compatibility matrices.

@MaartenGr
Copy link
Owner

@jsjtadie Is that your response or that of an LLM? Could you explain in more detail what exactly the OP should do here?

@0xtunafresh The best thing to do in these situations is to start from a completely fresh environment and then install the required dependencies. Make sure to run pip install bertopic[spacy] as that will attempt to install them both together.
If that does not work, then I would advise sharing this issue on the official spacy repository. Since your code doesn't seem to be using BERTopic but merely installing it, it might be better suited over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants