Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [E050] Can't find model 'de_core_news_sm'... only on debug mode #4638

Closed
yennguyenh opened this issue Nov 13, 2019 · 5 comments
Closed
Labels
install Installation issues models Issues related to the statistical models

Comments

@yennguyenh
Copy link

yennguyenh commented Nov 13, 2019

After installing spacy pip3 install -U spacy and downloading python -m spacy download de_core_news_sm, I can run the following code:

import spacy

nlp = spacy.load("de_core_news_sm")

text = "Das ist den Tisch"

my_doc = nlp(text)

token_list = []
for token in my_doc:
    token_list.append(token.text)
print(token_list)

Then I tried to debug the code (on Pycharm) and got the following error:
OSError: [E050] Can't find model 'de_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

I have also tried the solution from #4577 but did not work!

import de_core_news_sm
nlp = de_core_news_sm.load()

Does anybody know the reason and how to fix it? Thank you in advanced!

  • Operating System: MacOS
  • Python Version Used: 3.6.8
  • spaCy Version Used: 2.1.6
  • IDE: Pycharm
@adrianeboyd adrianeboyd added the install Installation issues label Nov 13, 2019
@adrianeboyd
Copy link
Contributor

Hi, make sure you're installing spacy and the models in the same virtual environment and with python/pip from the same place in your path. The combination of pip3 and python (vs. python3) makes it look like you might be mixing up virtual environments or python2 vs. python3, which means possibly that spacy and the model aren't installed in the same place. You can check with pip list (or pip3 list) that you can see both spacy and en-core-web-sm.

@yennguyenh
Copy link
Author

Sorry for the mistake, I actually also used python3 for the model download! And I did check the pip3 list and they both exist together. So I guess it is not the problem :(

@ines
Copy link
Member

ines commented Nov 13, 2019

If import de_core_news_sm doesn't work, this definitely means that the current environment doesn't have that package installed. So it must have somehow ended up in a different environment. If you want to be extra safe, you can always download and install the models directly via pip and then install them just like any other Python package.

@ines ines added the models Issues related to the statistical models label Nov 13, 2019
@yennguyenh
Copy link
Author

yennguyenh commented Nov 15, 2019

Thank you @ines It turned out that I made a silly mistake setting the wrong environment for Pycharm! So there is nothing wrong with spaCy but my personal mistake!

@lock
Copy link

lock bot commented Dec 15, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
install Installation issues models Issues related to the statistical models
Projects
None yet
Development

No branches or pull requests

3 participants