neuralcoref icon indicating copy to clipboard operation
neuralcoref copied to clipboard

AttributeError: type object 'neuralcoref.neuralcoref.array' has no attribute '__reduce_cython__'

Open binfeng opened this issue 5 years ago • 8 comments

Happens when I do:

pip uninstall neuralcoref
pip install neuralcoref --no-binary neuralcoref

# Load your usual SpaCy model (one of SpaCy English models)
import spacy
nlp = spacy.load('en')

# Add neural coref to SpaCy's pipe
import neuralcoref
neuralcoref.add_to_pipe(nlp)

# You're done. You can now use NeuralCoref as you usually manipulate a SpaCy document annotations.
doc = nlp(u'My sister has a dog. She loves him.')

doc._.has_coref
doc._.coref_clusters

binfeng avatar Jun 19 '20 21:06 binfeng

Have you tried starting from a new virtual environment ?

svlandeg avatar Jun 22 '20 07:06 svlandeg

Happens when I do:

pip uninstall neuralcoref
pip install neuralcoref --no-binary neuralcoref

# Load your usual SpaCy model (one of SpaCy English models)
import spacy
nlp = spacy.load('en')

# Add neural coref to SpaCy's pipe
import neuralcoref
neuralcoref.add_to_pipe(nlp)

# You're done. You can now use NeuralCoref as you usually manipulate a SpaCy document annotations.
doc = nlp(u'My sister has a dog. She loves him.')

doc._.has_coref
doc._.coref_clusters

Hey, Did you find a solution for this problem?

paranjaygpt6 avatar Jul 13 '20 08:07 paranjaygpt6

Have you tried starting from a new virtual environment ?

Uninstalling using: pip uninstall neuralcoref, reinstalling using: pip install neuralcoref --no-binary neuralcoref

And then restarting the kernel of my env solved the issue and the model imports just fine. For me the issue arose from not restarting the kernel between reinstallation and importing.

stephenmathew avatar Aug 24 '20 15:08 stephenmathew

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 08 '22 22:01 stale[bot]

I was recently getting this error when I try to use neuralcoref on Colab (Python 3.7). If I reinstalled neuralcoref (like @stephenmathew suggests) and then restarted the runtime, I kept getting the spacy.strings.StringStore size changed error. If I restarted the runtime after reinstalling, I would get this no attribute '__reduce_cython__' error.

The solution was using spacy 2.1: python -m pip install spacy==2.1.0

lara-martin avatar Feb 28 '22 17:02 lara-martin

I'm facing the same issue:

spaCy version 3.2.3 Location C:\Users\botti\anaconda3\envs\tesienv\lib\site-packages\spacy Platform Windows-10-10.0.22000-SP0 Python version 3.7.11 Pipelines en_core_web_md (3.0.0), en_core_web_sm (3.2.0), it_core_news_md (3.0.0)

fbottazzoli avatar Mar 28 '22 18:03 fbottazzoli

@fbottazzoli , read @lara-martin's message carefully... use spacy 2.1

DataStrategist avatar May 25 '22 10:05 DataStrategist

I'm facing the same issue:

spaCy version 3.2.3 Location C:\Users\botti\anaconda3\envs\tesienv\lib\site-packages\spacy Platform Windows-10-10.0.22000-SP0 Python version 3.7.11 Pipelines en_core_web_md (3.0.0), en_core_web_sm (3.2.0), it_core_news_md (3.0.0)

I was recently getting this error when I try to use neuralcoref on Colab (Python 3.7). If I reinstalled neuralcoref (like @stephenmathew suggests) and then restarted the runtime, I kept getting the spacy.strings.StringStore size changed error. If I restarted the runtime after reinstalling, I would get this no attribute '__reduce_cython__' error.

The solution was using spacy 2.1: python -m pip install spacy==2.1.0

Nope it didn't work

Herzeg137 avatar Sep 05 '22 10:09 Herzeg137