AttributeError: module 'spacy' has no attribute 'load'

Viewed 3581

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

Error: Traceback (most recent call last):

File "C:\Users\PavanKumar.spyder-py3\ExcelML.py", line 27, in nlp = spacy.load('en_core_web_sm')

AttributeError: module 'spacy' has no attribute 'load'

Can anyone suggest me a solution?

2 Answers

Don't name the file spacy.py, it will create conflict.

Try installing spacy again, I had the same problem, after running conda install spacy and restarting my notebook kernel it worked. For the complete installation documentation check the spacy official website: spacy documentation

Related