0

Installed plasticityai/magnitude (https://github.com/plasticityai/magnitude#installation)

Getting the following error when trying to run:

ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'

I have reinstalled spacy with newest version using pip3. Running python3.

Command I am trying to run:

python3 -m pymagnitude.converter -i /Users/rob/Desktop/videos/glove.6B/glove.6B.300d.txt -o /Users/rob/Desktop/vectors/

Full output:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/__init__.py", line 80, in <module>
    from pymagnitude.third_party.allennlp.commands.elmo import ElmoEmbedder
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 8, in <module>
    from allennlp.commands.configure import Configure
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 13, in <module>
    from allennlp.commands.predict import Predict
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/predict.py", line 54, in <module>
    from allennlp.predictors.predictor import Predictor, JsonDict
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/__init__.py", line 13, in <module>
    from allennlp.predictors.constituency_parser import ConstituencyParserPredictor
  File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/constituency_parser.py", line 7, in <module>
    from spacy.lang.en.tag_map import TAG_MAP
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'' ```

Nishant
  • 20,354
  • 18
  • 69
  • 101
  • You probably also need: `sudo python3 -m spacy download en`? Reference: https://stackoverflow.com/questions/47295316/importerror-no-module-named-spacy-en – Nishant Nov 30 '21 at 16:06
  • I have tried using the Remote loading, and also same error. Assume issue with my Spacy install. – user3765624 Nov 30 '21 at 16:11
  • Did you try the above command? It seems to load the `en` package separately. – Nishant Nov 30 '21 at 16:12
  • @Nishant thanks, I have that installed also, same issue. – user3765624 Nov 30 '21 at 16:14
  • 1
    Oh, ok then I would suggest to really confirm the exact version of spacy needed! I doubt it is not matching. – Nishant Nov 30 '21 at 16:14
  • Yes, i have run yours above, and "en_core_web_sm" - both satisfied. – user3765624 Nov 30 '21 at 16:15
  • 1
    Ah i have it. Unstalled spacy completely via pip, and works fine. So much have been using my local version (being incorrect version required). Thanks, not sure why didn't think of that earlier! – user3765624 Nov 30 '21 at 16:17

1 Answers1

-1

Issue is version of Spacy installed via pip was incorrect. Uninstalled Spacy from global pip, and works fine.