【问题标题】:Import spacy shows SyntaxError: invalid syntax导入 spacy 显示 SyntaxError: invalid syntax
【发布时间】:2020-07-08 10:19:55
【问题描述】:

我使用的是condo环境。

完整的堆栈跟踪:

Traceback (most recent call last):
  File "utils_exp.py", line 10, in <module>
    import spacy
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/spacy/__init__.py", line 12, in <module>
    from . import pipeline
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/spacy/pipeline/__init__.py", line 4, in <module>
    from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker
  File "pipes.pyx", line 1, in init spacy.pipeline.pipes
  File "nn_parser.pyx", line 1, in init spacy.syntax.nn_parser
  File "morphology.pyx", line 1, in init spacy.morphology
  File "vocab.pyx", line 18, in init spacy.vocab
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/spacy/lemmatizer.py", line 24
    def __init__(self, lookups, *args, is_base_form=None, **kwargs):
                                                  ^
SyntaxError: invalid syntax

使用 PyPy 安装 Spacy。

【问题讨论】:

    标签: python-2.7 conda spacy


    【解决方案1】:

    解决了这个问题

     conda install -c conda-forge spacy
    

    【讨论】:

      猜你喜欢
      • 2018-06-13
      • 2015-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-17
      相关资源
      最近更新 更多