C extension not loaded, training will be slow

2,346 views
Skip to first unread message

jan.po...@googlemail.com

unread,
May 12, 2018, 8:51:53 AM5/12/18
to gensim
Hi, I am runnign gensim on Suse. Everything seems to work, however, on startup the output is:

/usr/lib64/python3.4/site-packages/gensim/models/base_any2vec.py:323: UserWarning: C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training.  

I am a student and new to the topic and would appreciate your help.
Thank you!

Message has been deleted
Message has been deleted

Jan Portisch

unread,
May 14, 2018, 7:18:36 AM5/14/18
to gen...@googlegroups.com
Thank you very much for your help Gordon. The problem is that there is no error during the installation as far as I can judge:

sudo pip3 install gensim
xxxxxx password:
Collecting gensim
  Using cached https://files.pythonhosted.org/packages/04/a6/82ee7b14c204b82ec00e91fc6b67331cc7b28460ad72b2214384abd0e0a3/gensim-3.4.0.tar.gz
Requirement already satisfied: numpy>=1.11.3 in /usr/lib64/python3.4/site-packages (from gensim) (1.14.3)
Requirement already satisfied: scipy>=0.18.1 in /usr/lib64/python3.4/site-packages (from gensim) (1.1.0)
Requirement already satisfied: six>=1.5.0 in /usr/lib/python3.4/site-packages (from gensim) (1.11.0)
Requirement already satisfied: smart_open>=1.2.1 in /usr/lib/python3.4/site-packages (from gensim) (1.5.7)
Requirement already satisfied: boto>=2.32 in /usr/lib/python3.4/site-packages (from smart_open>=1.2.1->gensim) (2.48.0)
Requirement already satisfied: bz2file in /usr/lib/python3.4/site-packages (from smart_open>=1.2.1->gensim) (0.98)
Requirement already satisfied: requests in /usr/lib/python3.4/site-packages (from smart_open>=1.2.1->gensim) (2.18.4)
Requirement already satisfied: boto3 in /usr/lib/python3.4/site-packages (from smart_open>=1.2.1->gensim) (1.7.19)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.4/site-packages (from requests->smart_open>=1.2.1->gensim) (2.6)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.4/site-packages (from requests->smart_open>=1.2.1->gensim) (1.22)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.4/site-packages (from requests->smart_open>=1.2.1->gensim) (2018.4.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.4/site-packages (from requests->smart_open>=1.2.1->gensim) (3.0.4)
Requirement already satisfied: botocore<1.11.0,>=1.10.19 in /usr/lib/python3.4/site-packages (from boto3->smart_open>=1.2.1->gensim) (1.10.19)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/lib/python3.4/site-packages (from boto3->smart_open>=1.2.1->gensim) (0.9.3)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /usr/lib/python3.4/site-packages (from boto3->smart_open>=1.2.1->gensim) (0.1.13)
Requirement already satisfied: docutils>=0.10 in /usr/lib/python3.4/site-packages (from botocore<1.11.0,>=1.10.19->boto3->smart_open>=1.2.1->gensim) (0.14)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /usr/lib/python3.4/site-packages (from botocore<1.11.0,>=1.10.19->boto3->smart_open>=1.2.1->gensim) (2.7.3)
Installing collected packages: gensim
  Running setup.py install for gensim ... done
Successfully installed gensim-3.4.0

Am So., 13. Mai 2018 um 10:31 Uhr schrieb Gordon Mohr <goj...@gmail.com>:
Uninstall gensim. Install gensim again, watching the errors carefully for any reports of missing required tools. Correct the deficiency and try uninstalling/re-installing gensim again. Repeat until there are no errors reported during installation.

On Debian/Ubuntu systems, the package `build-essentials` may be enough to ensure the optimized C extensions build during installation. On SUSE, the equivalent *might* be `devel_basis` – but in general the process above should let you focus in on what's going wrong at the moment of installation, that results in the "C extension not loaded" error when later trying to use gensim.

- Gordon

--
You received this message because you are subscribed to the Google Groups "gensim" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gensim+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Snijesh VP

unread,
Jan 31, 2019, 2:25:08 AM1/31/19
to Gensim

sudo pip3 uninstall gensim    
sudo apt-get install python3-dev build-essential      
sudo pip3 install --upgrade gensim


Reply all
Reply to author
Forward
0 new messages