我一直试图导入spacy,但每次都会出现错误。我使用这一行来安装这个包:
conda install -c conda-forge spacy然后我尝试导入spacy,它给了我这个错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-76a01d9c502b> in <module>
----> 1 import spacy
~\Python\Text\spacy.py in <module>
9 import spacy
10 # Load English tokenizer, tagger, parser, and NER
---> 11 nlp = spacy.load('en_core_web_sm')
12 # Process whole documents
13 text = ("When Sebastian Thrun started working on self-driving cars at "
AttributeError: partially initialized module 'spacy' has no attribute 'load' (most likely due to a circular import)有人能帮我吗。
发布于 2021-06-08 16:11:07
问题是您正在处理的文件名为spacy.py,它干扰了spacy模块。因此,您应该将您的文件重命名为"spacy“以外的其他内容。
https://stackoverflow.com/questions/67890652
复制相似问题