dbmi-pitt / SocialMediaDataScience

Data Science module - text analytics, Natural Language Processing, and Machine Learning on Social Media (twitter) data
24 stars 50 forks source link

Exercise 3.1.2 #11

Closed Sooter-L closed 5 years ago

Sooter-L commented 5 years ago

When I run:

import spacy nlp = spacy.load('en') for name,proc in nlp.pipeline: print(name,proc)

I get the following error:


OSError Traceback (most recent call last)

in () 1 import spacy ----> 2 nlp = spacy.load('en') 3 for name,proc in nlp.pipeline: 4 print(name,proc) ~\Anaconda3\lib\site-packages\spacy\__init__.py in load(name, **overrides) 19 if depr_path not in (True, False, None): 20 deprecation_warning(Warnings.W001.format(path=depr_path)) ---> 21 return util.load_model(name, **overrides) 22 23 ~\Anaconda3\lib\site-packages\spacy\util.py in load_model(name, **overrides) 117 elif hasattr(name, 'exists'): # Path or Path-like to model data 118 return load_model_from_path(name, **overrides) --> 119 raise IOError(Errors.E050.format(name=name)) 120 121 OSError: [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. How do I fix this? Thanks.
Sooter-L commented 5 years ago

I have tried the suggestions in the closed thread on this topic, and they haven't worked for me.

Thanks.

lobstaboy commented 5 years ago

Hi Sooter-L, I was having the same problem. I found some people having similar problems on a google search and tried to install the package in the terminal using:

python -m spacy download en

It then gave me another error:

msgpack/_unpacker.pyx in msgpack._unpacker.unpackb() TypeError: unpackb() got an unexpected keyword argument 'raw'

I am using Anaconda, and after a couple things didn't work I just updated my version of Jupyter, and now it seems to be working ok. Cheers.

Sooter-L commented 5 years ago

Thank you very much for your suggestion! That worked! I updated Anaconda and I also installed spaCy and the 'en' module using the Anaconda Prompt. It works now.