问题
I used pyinstaller to convert my Python file to exe. While executing it I got the below error,
AttributeError: type object 'neuralcoref.neuralcoref.array' has no attribute 'reduce_cython' I'm using Python 3.6.7, Pyinstaller 4.0, NeuralCoref 4, Spacy 2.1.0, Cython 0.27.3.
Any suggestion to solve this or better way to convert .py to exe? I've tried py2exe, Cxfreee but doesnt work.
A minimal version of my code:
import neuralcoref
def ApplyCorefResolutionToPreProcessedMail(text, nlp):
# load NeuralCoref and add it to the pipe of SpaCy's model
coref = neuralcoref.NeuralCoref(nlp.vocab)
nlp.add_pipe(coref, name='neuralcoref')
doc = nlp(text)
corefresolvedmail = doc._.coref_resolved
return corefresolvedmail
I have attached the stack trace below,
回答1:
This might be resolved in cython 0.28 look here https://github.com/cython/cython/issues/1953
来源:https://stackoverflow.com/questions/57175603/has-no-attribute-reduce-cython-error-when-using-pyinstaller-exe