Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gensim needs a C compiler?

Sorry that I don't have enough reputation to post images.

The main problem is that it tells me that I need to install a C compiler and reinstall gensim or the train will be slow, and in fact it is really slow.

I have installed mingw32, Visual Studio 2008, and have added the mingw32 environment variable to my path.

Any ideas on how to solve it?

like image 229
Liujiajun Avatar asked Oct 31 '22 22:10

Liujiajun


2 Answers

Just as you I installed mingw32 and added MinGW\bin to my PATH variable. I then uninstalled gensim with pip uninstall gensim and tried reinstalling with pip install gensim. That however gave the same warning so instead I downloaded gensim-0.12.3.tar.gz from here. I unzipped the archive and also the inner one, opened a cmd window in the folder and ran python setup.py install to install gensim. Now I could already from the output see that it could see the MinGW install. It installed correctly and I could run gensim without the warning and much faster.

like image 152
user1151923 Avatar answered Nov 15 '22 04:11

user1151923


Similar to user1151923, after adding MinGW\bin to my path variable and uninstalling\reinstalling gensim through pip, I still received the same warning message. I ran the following code to fix this problem (installed gensim from conda).

pip uninstall gensim

conda install gensim

like image 42
cjmorale Avatar answered Nov 15 '22 04:11

cjmorale