explosion / spaCy

💫 Industrial-strength Natural Language Processing (NLP) in Python
https://spacy.io
MIT License
29.83k stars 4.38k forks source link

AttributeError: module 'spacy' has no attribute 'blank' #1670

Closed iamredencio closed 6 years ago

iamredencio commented 6 years ago

I am trying to run the example code on page

But I get the following error:

Traceback (most recent call last):
  File "trainNer.py", line 98, in <module>
    plac.call(main)
  File "C:\Users\M63C755\AppData\Local\Continuum\anaconda3\lib\site-packages\plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "C:\Users\M63C755\AppData\Local\Continuum\anaconda3\lib\site-packages\plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "trainNer.py", line 41, in main
    nlp = spacy.blank('en')  # create blank Language class
AttributeError: module 'spacy' has no attribute 'blank'``

Can someone tell me what to do?

I did not change anything of the code.

ines commented 6 years ago

Quick update in case anyone else comes across this issue: The most likely explanation is that the code is using the wrong spaCy version, i.e. v1.x (which didn't yet have a .blank attribute) instead of spaCy v2.x.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.