How to fix 'C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training.'

家住魔仙堡 提交于 2019-12-20 01:06:46

问题


I'm using the library node2vec, which is based on gensim word2vec model to encode nodes in an embedding space, but when i want to fit the word2vec object I get this warning:

C:\Users\lenovo\Anaconda3\lib\site-packages\gensim\models\base_any2vec.py:743: UserWarning: C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training.

Can any one help me to fix this issue please ?


回答1:


gensim relies on extension modules that need to be compiled. Both defaults and the conda-forge channel provide prebuilt versions that will work out of the box.

conda install gensim

or

conda install -c conda-forge gensim

are probably the easiest way to get gensim to work.




回答2:


For me, degrading back to Gensim version 3.7.1 from 3.7.3 worked.




回答3:


anaconda prompt conda update conda-build

== windows 7 (32bit) python 3.7.3 conda-build 3.18.5 gensim 3.4.0




回答4:


I've faced this issue for a long time when I was running W2V Models which requires 'gensim'. First of all I've installed Anaconda Navigator and then installed required packages using pip. I've installed gensim manually using pip in cmd. When I run the W2V model, it took 40 min to train and give the result, which made me annoying and wasted a lot of time.

This problem got solved now. I just did what the warning showed. I've uninstalled gensim from my computer. Prior to that I've already created a system path of mingw-w64 in the environment variable which is an environment for c,c++ etc., programs. Later, I've reinstalled gensim using 'pip install gensim'.

Now the program is running within seconds which made a drastic change in the execution time.

Hope this helps...



来源:https://stackoverflow.com/questions/55978013/how-to-fix-c-extension-not-loaded-training-will-be-slow-install-a-c-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!