neuralcoref: ValueError: spacy.strings.StringStore size changed, may indicate binary incompatibility. Expected 80 from C header, got 64 from PyObject
I am using python ==3.8.3, spacy==3.0.5, neuralcoref ==4.0. These libraries are successfully installed. When running the code
import spacy import neuralcoref
nlp = spacy.load(‘en’) neuralcoref.add_to_pipe(nlp) doc1 = nlp(‘My sister has a dog. She loves him.’) print(doc1._.coref_clusters)
I get the error.
Traceback (most recent call last): File “d:/Comp4550/xxxxxxxxxxxxxxx/code/analysis/co-reference.py”, line 2, in <module> import neuralcoref File “D:\python3.8.3\lib\site-packages\neuralcoref_init_.py”, line 14, in <module> from .neuralcoref import NeuralCoref File “strings.pxd”, line 23, in init neuralcoref.neuralcoref ValueError: spacy.strings.StringStore size changed, may indicate binary incompatibility. Expected 80 from C header, got 64 from PyObject
I search the error code in google and I get this from stackoverflow [https://stackoverflow.com/questions/67041981/valueerror-spacy-strings-stringstore-size-changed-may-indicate-binary-incompat] . It suggests me to downgrade the python version. However, python version cannot be changed due to the particular project. I wonder that if there exists a way for me to successfully run the test code.
By the way, I also try pip uninstall neuralcoref
, pip install neuralcoref --no-binary neuralcoref
. The problem is still not resolved. If anyone can solve my problem, I am really appreciate that.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 15 (1 by maintainers)
Hey all, as @correia-marcos mentioned, I figured that there seems to be some compatibility issue between spacy v3 and neuralcoref. Here are the steps I did to make it work:
conda install -c anaconda git
README.md
,2.3.x
(verify usingpip show spacy
), because therequirements.txt
did explicitly stated that spacy version has to be<3.0.0
. Hence, DO NOT executepip install -U spacy
, which would upgrade your spacy version to beyond3.0.0
.python -m spacy download en
to obtain your English Model.Summary of key item versions:
Hope this helped! 😃
Thanks, @manekiyong – I guess I was hoping we could get the compatibility issue fixed so we could use both neuralcoref and the fancy new features of spacy 3.0.
But again, thank you for taking the time to respond with such clear instructions.
thank u
Issue seems to have been created by one of the recent commits. I used feb 2020 version of the neuralcoref library (commit ‘73d07e97fe’) and it seems to have been installed at least. Leaving it here as it might help someone else. Works with both python versions 3.6.9 and 3.7.10.
I’ve tried so many things. Seeing others issues I came to realized neuralcoref doesn’t work in spacy v3 (see [stackoverflow] also (https://stackoverflow.com/questions/57008612/kernel-died-when-running-neuralcoref)). The problem for me now is actually how to download spacy pipeline for v2 versions? Seems stupidly easy, but I can’t find in the documentation.
same here… can’t import why? thx!
Also having this issue; I’m using a Win10 PC in a conda environment with config:
When I run the code:
I get the error:
What I tried:
Any help would be very much appreciated!