1

我遇到了一个我似乎无法弄清楚的问题。我第一次将 Spacy 导入 Jupyter 笔记本时没有任何问题。它只是按我的预期导入了它。

import spacy
nlp = spacy.load('en_core_web_sm')

我试过了


import sys
print(sys.executable)

我得到了这个错误

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-21-e4c801bd61f2> in <module>
----> 1 import spacy
      2 nlp = spacy.load('en_core_web_sm')

~/Downloads/PREFIX=/home/khbe0387/anaconda3/lib/python3.8/site-packages/spacy/__init__.py in <module>
      9 
     10 # These are imported as part of the API
---> 11 from thinc.api import prefer_gpu, require_gpu, require_cpu  # noqa: F401
     12 from thinc.api import Config
     13 

ImportError: cannot import name 'prefer_gpu' from 'thinc.api' (/home/khbe0387/Downloads/PREFIX=/home/khbe0387/anaconda3/lib/python3.8/site-packages/thinc/api.py)
4

0 回答 0