问题
I am trying to import spacy in vain.
>>> import spacy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Alienware\Anaconda3\envs\tf2\lib\site-packages\spacy\__init__.py", line 12, in <module>
from . import pipeline
File "C:\Users\Alienware\Anaconda3\envs\tf2\lib\site-packages\spacy\pipeline\__init__.py", line 4, in <module>
from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker
File "pipes.pyx", line 24, in init spacy.pipeline.pipes
File "C:\Users\Alienware\Anaconda3\envs\tf2\lib\site-packages\spacy\pipeline\functions.py", line 5, in <module>
from ..matcher import Matcher
File "C:\Users\Alienware\Anaconda3\envs\tf2\lib\site-packages\spacy\matcher\__init__.py", line 5, in <module>
from .phrasematcher import PhraseMatcher
File "phrasematcher.pyx", line 1, in init spacy.matcher.phrasematcher
ImportError: preshed.maps does not export expected C function map_clear
I updated conda and then run update conda all. I removed the previous version of python and installed the newest one (3.8). I uninstalled spacy and reinstalled it. Nothing worked.
The last time I worked with spacy was 3 weeks ago and I did not face any problem. All of a sudden this exception erupted out of nowhere.
What is your understanding of the situation? Any ideas on how to debug the problem or remedy the failure?
来源:https://stackoverflow.com/questions/61255926/can-not-import-spacy-importerror-preshed-maps-does-not-export-expected-c-func