首页 > 解决方案 > python在尝试加载spacy时抛出一些错误

问题描述

import pandas as pd
from ast import literal_eval
from nltk.corpus import stopwords
import string


stops = stopwords.words('english')
stops.extend(['none'])

import nltk

import re
import numpy as np
from pprint import pprint

import gensim
import gensim.corpora as corpora
from gensim.utils import simple_preprocess # for tokenizing
from gensim.models import CoherenceModel
from sklearn.feature_extraction import stop_words

import spacy

错误是:


来自 sklearn.feature_extraction 的 20 中的 AttributeError Traceback (最近一次调用最后一次) 导入 stop_words 21 ---> 22 import spacy 23 24 import pyLDAvis

~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy__init__.py in 10 from thinc.neural.util import prefer_gpu, require_gpu 11 ---> 12 from . 从 .cli.info 导入管道 13 导入信息作为 cli_info 14 从 .glossary 导入说明

~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy\pipeline__init__.py in 2 from __future__ import unicode_literals 3 ----> 4 from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker 5 from .pipes import TextCategorizer、Tensorizer、Pipe、Sentencizer 6 from .morphologizer 导入 Morphologizer

初始化 spacy.pipeline.pipes() 中的管道.pyx

~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy\syntax\nn_parser.cp37-win_amd64.pyd init spacy.syntax.nn_parser()

AttributeError:类型对象“spacy.syntax.nn_parser.array”没有属性“__reduce_cython__”

标签: pythonnlpinstallationpackagespacy

解决方案


推荐阅读