环境:ubuntu 14.04, anaconda python 2.7
在Anaconda环境下安装gensim,直接安装是无法使用FAST_MODE的。因为anaconda中带有的scipy是没有BLAS原生库支持的。这样安装的gensim调用scipy中的算法时,无法使用C语言原生库进行计算,速度会比较慢。
表现出来的现象就是,
UserWarning: C extension not loaded for Word2Vec, training will be slow. Install a C compiler and reinstall gensim for fast training.
一开始遇到这个问题,我以为是因为在安装gensim时没有C编译器,所以相应类库无法从源码编译。但安装了build-essential
之后重新安装gensim,问题依旧存在。而且在使用pip或anaconda安装gensim时并没有编译的过程,即使下载源码编译并且使用 python setup.py build_ext --inplace
。于是断定问题应该出在间接调用的模块中。
经过搜索,在google group 中进一步定位到问题:
The scipy version (0.16.0) I am using does not have the
scipy.linalg.blas.fblas
module as it has been depracated. The Cython/C wrapper for the fast bit of word