7

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: 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. "

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

1 Answers1

4

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:

Uninstall Gensim

sudo pip3 uninstall gensim

Install python3-dev build-essential

sudo apt-get install python3-dev build-essential  

Re-Install Gensim

sudo pip3 install --upgrade gensim

Notes:

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

  • The key is the `python3-dev` (or in Py2, just `python-dev`) and `build-essential` packages. If they are present when gensim is installed, the optimized code included with the package can be compiled. (`cython` isn't actually necessary unless you're further customizing that code.) – gojomo Aug 04 '17 at 17:24
  • 1
    How to solve this problem in a windows environment with Python 3 on it? – Agent47 Feb 04 '19 at 09:34
  • 1
    what is the speed difference with and without? – Joris Jun 03 '19 at 16:38
  • 1
    Like @AkilaAmarasinghe, I wanted to find a solution on Windows. This resolved it: https://stackoverflow.com/a/55986444/5433896. – Sander Vanden Hautte Jun 28 '19 at 13:15