gpt4 book ai didi

python - 导入spaCy错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:36:41 24 4
gpt4 key购买 nike

当我尝试导入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

建议我重新编译。我应该怎么做才能修复这个错误?

最佳答案

这可能是与 thincspacy 的版本冲突。 Thinc v6.9.0 已修复!

我建议您使用 sudo pip uninstall Thincsudo pip3 uninstall Thinc 进行卸载,并重新安装此处提供的 Thinc 版本 6.9.0:https://pypi.python.org/pypi/thinc

关于python - 导入spaCy错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46887236/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com