IOError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a

错误:

IOError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

解决方案:

python -m spacy download en

from: http://w3schoolquiz.com/question/pycharm-cant-find-spacy-model-en/

I am trying to load a NLP model ‘en’ from SpaCy in my PyCharm and I am using Python 2.7 .
My code to load the ‘en’ model is
nlp = spacy.load('en', disable=['parser', 'ner'])
However, I received the following error
IOError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
I then realised that I didn’t download the model, so I used the terminal provided in PyCharm to download the model, I used python -m spacy download en

This was the following output:

Requirement already satisfied: en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.
tar.gz#egg=en_core_web_sm==2.0.0 in c:python27libsite-packages
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
You do not have sufficient privilege to perform this operation.

Linking successful
C:Python27libsite-packagesen_core_web_sm –>
C:Python27libsite-packagesspacydataen

You can now load the model via spacy.load(‘en’)

So I am quite confused… I presume that I was unable to download the ‘en’ model as I do not have enough privileges to do so, but how was the linking successful?
Upon seeing this message, I tried running my Python file again ( since the terminal stated that linking was successful) but the initial error popped out again.

Has anybody encountered this problem before, or knows how to solve this error? How am I able to ‘escalate’ my privileges in PyCharm terminal so that I will be able to download the model?

你可能感兴趣的:(自然语言处理)