未为Word2Vec加载C扩展名 [英] C extension not loaded for Word2Vec

查看:204
本文介绍了未为Word2Vec加载C扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新安装了gensim pkg和Cython,但它继续显示此警告, 有人知道吗? 我正在使用Python 3.6,PyCharm Linux Mint.

I re-install the gensim pkg and Cython but it continusly show this warning, Does anybody know about this? I am using Python 3.6,PyCharm Linux Mint.

UserWarning:未为Word2Vec加载C扩展名,培训会很慢.安装C编译器,然后重新安装gensim以进行快速培训. warnings.warn(未为Word2Vec加载C扩展名,培训速度会很慢."

UserWarning: C extension not loaded for Word2Vec, training will be slow. Install a C compiler and reinstall gensim for fast training. warnings.warn("C extension not loaded for Word2Vec, training will be slow. "

当我创建或加载模型时,它也会显示此行.
正在使用慢版本的gensim.models.doc2vec

And it also show this line when I create or load model.
Slow version of gensim.models.doc2vec is being used

推荐答案

某些基础软件包不是最新的存在一些问题. 在这里我找到了适合我的答案,简而言之:

There is some problem with the some underlying packages not being up to date. Here I found the answer which work for me, which is in short:

卸载Gensim

sudo pip3 uninstall gensim

安装python3-dev build-essential

Install python3-dev build-essential

sudo apt-get install python3-dev build-essential  

重新安装Gensim

Re-Install Gensim

sudo pip3 install --upgrade gensim

注意:

以上说明适用于使用pip和apt-get管理软件包的系统
pip3是pip的python3版本

Instructions above are for systems where pip and apt-get are used to manage packages
pip3 is the python3 version of pip

这篇关于未为Word2Vec加载C扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆