0

安装的可塑性/幅度(https://github.com/plasticityai/magnitude#installation

尝试运行时出现以下错误:

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

我已经使用 pip3 重新安装了最新版本的 spacy。运行python3。

我正在尝试运行的命令:

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

完整输出:

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'' ```

4

1 回答 1

-1

问题是通过 pip 安装的 Spacy 版本不正确。从全局 pip 卸载 Spacy,并且工作正常。

于 2021-11-30T16:19:22.467 回答