Windows下运行gensim提示没有C编译器解决方案

Windows下运行gensim提示没有C编译器解决方案

在windows下装gensim跑word2vec的时候遇到了一个坑,记录下来怕以后忘记。


问题描述:没有C扩展

最开始用pip安装gensim后,运行下面代码会报一个warning。

from gensim.test.utils import common_texts
from gensim.models import Word2Vec
model = Word2Vec(common_texts, size=100, window=5,
/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py:21: UserWarning: Pandas requires version '2.8.4' or newer of 'numexpr' (version '2.8.1' currently installed). from pandas.core.computation.check import NUMEXPR_INSTALLED /Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/pandas/core/arrays/masked.py:60: UserWarning: Pandas requires version '1.3.6' or newer of 'bottleneck' (version '1.3.4' currently installed). from pandas.core import ( Traceback (most recent call last): File "/Users/bellawu/Documents/毕业论文/LDA代码/process.py", line 6, in <module> from gensim import corpora File "/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/gensim/__init__.py", line 11, in <module> from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401 File "/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/gensim/corpora/__init__.py", line 6, in <module> from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes File "/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/gensim/corpora/indexedcorpus.py", line 14, in <module> from gensim import interfaces, utils File "/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/gensim/interfaces.py", line 19, in <module> from gensim import utils, matutils File "/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/gensim/matutils.py", line 22, in <module> from scipy.linalg.special_matrices import triu ImportError: cannot import name 'triu' from 'scipy.linalg.special_matrices' (/Users/bellawu/opt/anaconda3/lib/python3.9/site-packages/scipy/linalg/special_matrices.py)这是什么问题
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值