当我尝试导入spaCy (第一次)时,我得到以下错误:
>>>import spacy
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import spacy
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spacy/__init__.py", line 10, in <module>
from . import en, de, zh, es, it, hu, fr, pt, nl, sv, fi, bn, he, nb, ja
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spacy/en/__init__.py", line 4, in <module>
from ..language import Language
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spacy/language.py", line 14, in <module>
from .pipeline import DependencyParser, EntityRecognizer
File "spacy/pipeline.pyx", line 1, in init spacy.pipeline (spacy/pipeline.cpp:16536)
# coding: utf8
File ".env/lib/python2.7/site-packages/thinc/extra/search.pxd", line 72, in init spacy.syntax.beam_parser (spacy/syntax/beam_parser.cpp:20037)
ValueError: thinc.extra.search.MaxViolation has the wrong size, try recompiling这建议我应该重新编译。我应该怎么做才能修复这个错误?
发布于 2017-10-23 18:59:32
可能是与thinc或spacy的版本冲突。它已在thinc v6.9.0中修复!
我建议您使用sudo pip uninstall thinc或sudo pip3 uninstall thinc卸载,然后重新安装此处提供的THINC6.9.0版:https://pypi.python.org/pypi/thinc
发布于 2017-11-07 23:43:32
问题可能出在thinc软件包上,对于spacy -每晚都需要thinc<6.9.0,>=6.8.1,但是版本6.8.2导致了一些问题-->我认为spacy也会有同样的问题;解决方法是在安装spacy之前运行下面的命令
pip install thinc==6.8.1https://stackoverflow.com/questions/46887236
复制相似问题