Spacy导入错误:无法从“spacy.lang.char_classes”导入名称“COMBINING_DIACRITICS”

[ad_1]

当我尝试使用 import spacy 导入 NLP 库“Spacy”时,出现以下错误:

Python
ImportError: cannot import name 'COMBINING_DIACRITICS' from 'spacy.lang.char_classes'

这是我的版本:

spacy==3.7.2
spacy-legacy==3.0.12

thinc==8.2.2

pydantic==1.8.2
pydantic_core==2.14.6

python version - 3.9.18

完整错误:

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_33180\572880994.py in 
----> 1 import spacy

c:\Users\anaconda3\lib\site-packages\spacy\__init__.py in 
     11 from thinc.api import Config, prefer_gpu, require_cpu, require_gpu  # noqa: F401
     12 
---> 13 from . import pipeline  # noqa: F401
     14 from . import util
     15 from .about import __version__  # noqa: F401

c:\Users\anaconda3\lib\site-packages\spacy\pipeline\__init__.py in 
----> 1 from .attributeruler import AttributeRuler
      2 from .dep_parser import DependencyParser
      3 from .edit_tree_lemmatizer import EditTreeLemmatizer
      4 from .entity_linker import EntityLinker
      5 from .entityruler import EntityRuler

c:\Users\anaconda3\lib\site-packages\spacy\pipeline\attributeruler.py in 
      6 from .. import util
      7 from ..errors import Errors
----> 8 from ..language import Language
      9 from ..matcher import Matcher
     10 from ..scorer import Scorer
...
      3     ALPHA_LOWER,
      4     ALPHA_UPPER,
      5     COMBINING_DIACRITICS,

ImportError: cannot import name 'COMBINING_DIACRITICS' from 'spacy.lang.char_classes' (c:\Users\anaconda3\lib\site-packages\spacy\lang\char_classes.py)

我尝试过的:

我尝试安装、卸载 Spacy、升级库以及所有其他常见检查。 问题出在哪里?

解决方案1

解决方案2

通过创建新的解决了该问题 康达环境 & 安装 Spacy。

[ad_2]

コメント

标题和URL已复制