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

Problem with spacy.load('en') #1721

Closed
jianzhengming opened this issue Dec 13, 2017 · 14 comments
Closed

Problem with spacy.load('en') #1721

jianzhengming opened this issue Dec 13, 2017 · 14 comments
Labels
install Installation issues models Issues related to the statistical models windows Issues related to Windows

Comments

@jianzhengming
Copy link

I have some related issues, I download the 'en' model,
$ python3 -m spacy download en $, yield
Linking sucessful
/home/abc/miniconda3/lib/python3.6/site-packages/en_core_web_sm -->
/home/abc/miniconda3/lib/python3.6/site-packages/spacy/data/en

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

However, when I use it
$nlp=spacy.load('en')$
I still get the information "OSError: Can't find model 'en'"

@bharathjatoth
Copy link

Please try to install this and see
conda install spacy
python -m spacy.en.download
python -c "import spacy; spacy.load('en')"

@ines
Copy link
Member

ines commented Jan 3, 2018

Looks like this is the same issue as #1761, so merging both to keep everything in one place. I also just submitted a fix that will hopefully solve the underlying problem – see #1792.

@ines ines closed this as completed Jan 3, 2018
@ines ines added install Installation issues models Issues related to the statistical models windows Issues related to Windows labels Jan 3, 2018
@Ashish-Gupta03
Copy link

Ashish-Gupta03 commented Feb 5, 2018

Try this....
pip install spacy && python -m spacy download en

This worked for me.

@FrancescoSaverioZuppichini

I have installed with Python3, if I try to run python3 -m spacy download en I get this error:

raceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from .cli.info import info as cli_info
  File "/usr/local/lib/python3.6/site-packages/spacy/cli/__init__.py", line 1, in <module>
    from .download import download
  File "/usr/local/lib/python3.6/site-packages/spacy/cli/download.py", line 10, in <module>
    from .link import link
  File "/usr/local/lib/python3.6/site-packages/spacy/cli/link.py", line 8, in <module>
    from ..util import prints
  File "/usr/local/lib/python3.6/site-packages/spacy/util.py", line 8, in <module>
    import regex as re
  File "/usr/local/lib/python3.6/site-packages/regex.py", line 683, in <module>
    _pattern_type = type(_compile("", 0, {}))
  File "/usr/local/lib/python3.6/site-packages/regex.py", line 436, in _compile
    pattern_locale = _getlocale()[1]
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 581, in getlocale
    return _parse_localename(localename)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 490, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

@soumendrak
Copy link

soumendrak commented Feb 26, 2018

This worked for me.

pip install -U spacy && python -m spacy download en

@FrancescoSaverioZuppichini

I can't, I have python3 and python does not exist as a command

@whyboris
Copy link

whyboris commented Mar 8, 2018

I think this might work with python3
pip3 install spacy && python3 -m spacy download en

@FrancescoSaverioZuppichini

nope

@AlbertoTP
Copy link

Yea, try with conda
@whyboris in Python3 works

and in python 2.7 have an error to download link
you can check, with this command, the install models:
python -m spacy validate
here, you can see the model "en":
type link, name en, model ..., ver...

try the command:
sudo python -m spacy download en
wait a moment and you can see:
You can now load the model via spacy.load('en')

if you see Error: Couldn't link model to 'en'
you use
nlp = spacy.load('en_core_web_sm')
and works

@bharathjatoth
Copy link

simple which worked for me is install the wheel packages which we get from https://www.lfd.uci.edu/~gohlke/pythonlibs/
search for relevant wheel package and install them just by "pip install "

@deenaik
Copy link

deenaik commented Mar 16, 2018

@FrancescoSaverioZuppichini
If you have faced the error on MacOS X, here's the quick fix - add these lines to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

@FrancescoSaverioZuppichini

Thank you, it works!

@robertpknight
Copy link

robertpknight commented Apr 1, 2018

I found this work around to install the en module directly in the last comment, and it has worked for me:
https://github.com/explosion/spaCy/issues/916

@lock
Copy link

lock bot commented May 7, 2018

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 May 7, 2018
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 windows Issues related to Windows
Projects
None yet
Development

No branches or pull requests

10 participants