I tried to install spacy in a fresh virtual env, but after downloading the 'en_core_web_sm' model and loading, I get a ValueError to do with spacy.syntax.arg_eager (full stack trace to follow below):
$ virtualenv -p python3 ~/virtualenvs/spacy_2_0
...[creates venv]...
$ source ~/virtualenvs/spacy_2_0/bin/activate
(spacy_2_0) $ pip3 install spacy-nightly
...[installs spacy with no apparent issues, none reported, that is]...
(spacy_2_0) $ python3 -m spacy download en_core_web_sm
...
Linking successful
...
You can now load the model via spacy.load('en_core_web_sm')
(spacy_2_0) $ python3 -c "import spacy; nlp = spacy.load('en_core_web_sm')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/__init__.py", line 13, in load
return util.load_model(name, **overrides)
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/util.py", line 103, in load_model
return load_model_from_link(name, **overrides)
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/util.py", line 122, in load_model_from_link
return cls.load(**overrides)
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/data/en_core_web_sm/__init__.py", line 12, in load
return load_model_from_init_py(__file__, **overrides)
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/util.py", line 155, in load_model_from_init_py
return load_model_from_path(data_path, meta, **overrides)
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/util.py", line 136, in load_model_from_path
cls = get_lang_class(meta['lang'])
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/util.py", line 41, in get_lang_class
module = importlib.import_module('.lang.%s' % lang, 'spacy')
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/lang/en/__init__.py", line 15, in <module>
from ...language import Language
File "/Users/dennismehay/.virtualenvs/spacy_2_0/lib/python3.6/site-packages/spacy/language.py", line 19, in <module>
from .syntax.parser import get_templates
File "arc_eager.pxd", line 12, in init spacy.syntax.parser
File "search.pxd", line 72, in init spacy.syntax.arc_eager
ValueError: thinc.extra.search.MaxViolation has the wrong size, try recompiling. Expected 104, got 128
It looks to be an issue with thinc.
Am I doing something obviously wrong, or is this a bug or set-up issue? I thought it was that the wrong version of thinc might have been imported, so I did a sudo pip uninstall thinc and sudo pip3 uninstall thinc (outside of the venv), but I still have the same ValueError above.
I think I made a mistake with thinc 6.8.2 -- others have reported the same issue. This has puzzled me because it's been working for me?
Anyway the best mitigation atm is to do pip install thinc==6.8.1 before pip install spacy-nightly. This should let the thinc dependency be satisfied by the working version.
Sorry for the inconvenience.
| Sorry for the inconvenience.
Not at all. Thank you for the prompt fix.
(spacy_2_0) $ python3 -c "import spacy; nlp = spacy.load('en_core_web_sm'); print([t for t in nlp('It works now! Thanks.')])"
[It, works, now, !, , Thanks, .]
Sorry for the dupe. I tried to search for it, but must have used the wrong terms. (And github search is less than optimal.)
It was in the thinc repo and another side-channel -- so you couldn't have been expected to find it. No worries!
Should be fixed in spaCy v2.0.0a15 and Thinc v6.9.0!
Hi,
I tried to install spacy in a in Linux virtual machine AWS, but when I test the installation (python3 -m spacy info) I get the following error
thinc.extra.MaxViolation has wrong size
If I do spacy.load('en_core_web_sm') I get a MemoryError:
I test the suggestions above, but I still have the same error.
spaCy version: 2.0.0a14
Platform: Ubuntu 16.04.03 (64bit)
Python version: 3.5
Models: en_core_web_sm
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.
Most helpful comment
I think I made a mistake with thinc 6.8.2 -- others have reported the same issue. This has puzzled me because it's been working for me?
Anyway the best mitigation atm is to do
pip install thinc==6.8.1beforepip install spacy-nightly. This should let thethincdependency be satisfied by the working version.Sorry for the inconvenience.