Attribute error when trying to import Spacy

Viewed 169

I have some issues when I try to import spacy. I downloaded the package and have the newest version, but still I get this error and I cannot find any answer. Maybe someone here had this problem and can help me out here.

This is the error when I do "import spacy":


AttributeError Traceback (most recent call last) in () ----> 1 import spacy

~\Anaconda3\lib\site-packages\spacy_init_.py in () 8 9 # These are imported as part of the API ---> 10 from thinc.neural.util import prefer_gpu, require_gpu 11 12 from . import pipeline

~\Anaconda3\lib\site-packages\thinc_init_.py in () 6 7 from .about import name, version # noqa: F401 ----> 8 from ._registry import registry

~\Anaconda3\lib\site-packages\thinc_registry.py in () ----> 1 import catalogue 2 3 4 class registry(object): 5 optimizers = catalogue.create("thinc", "optimizers", entry_points=True)

~\Anaconda3\lib\site-packages\catalogue.py in () 16 17 # Only ever call this once for performance reasons ---> 18 AVAILABLE_ENTRY_POINTS = importlib_metadata.entry_points() 19 20 # This is where functions will be registered

AttributeError: module 'importlib_metadata' has no attribute 'entry_points'

Thanks in advance!

1 Answers

It's just a problem with your metadata package. Try this since you are using conda environments:

conda install -c conda-forge importlib_metadata

If you prefer pip, you can do

pip uninstall importlib_metadata 
pip install importlib_metadata --force-reinstall
Related