安装了一天的gensim,其中因为版本不一致等等各种问题纠结了好久,现记录如下:

正确安装方式:

1. 安装python2.7

2. 下载Python Extension Packages对应版本的numpy、scipy、gensim

3. 进入python安装目录下的Scripts目录

    执行: pip install numpy***.whl

               pip install scipy***.whl

               pip install gensim.whl

   测试:输入python命令进入python命令行,分别输入 import numpy; import scipy; import gensim;没有报错,即安装成功!

很简单啊~可是我就是倒腾了一天,原因大体归结为 版本不一致。

1. 原本机子上是有numpy和scipy的,但是以前貌似安装的win32版本的扩展包,存在冲突,所以gensim安装不了。

2. 卸载了原先装的numpy和scipy,参照 官网Gensim Installation,使用pip或者easy_install安装numpy\scipy,numpy成功,scipy报错“LAPACK and BLAS libraries not found”,

解释1解释2解释3等等都提到说需要Microsoft Visual C++ Compiler for Python 2.7,可是还是报这个错。

3. 安装时还遇到问题 —安装第三方库出现 Python version 2.7 required, which was not found in the registry

   运行脚本

import sys

from _winreg import *

# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
) def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print "*** Unable to register!"
return
print "--- Python", version, "is now registered!"
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print "=== Python", version, "is already registered!"
return
CloseKey(reg)
print "*** Unable to register!"
print "*** You probably have another Python installation!" if __name__ == "__main__":
RegisterPy()

3. 后来我试了pip install scipy**.whl 方法,安装scipy成功但是gensim不行,Github 解压,使用命令:python setup.py install ,安装有错。

4. 使用pip装whl文件,导入测试时有错误。

显示scipy包有问题。

5. 卸载了numpy、scipy,使用前面说的方法重新来过,就可以了。。

这个故事告诉我们,凡事都要从一而终,都是用pip install ***.whl才行。

安装gensim的更多相关文章

  1. Linux下安装Gensim

    依赖软件包:numpy 直接使用pip安装: [root@mycentos ~]#pip install gensim 安装gensim的时候会遇到下面的一系列错误: Cannot uninstall ...

  2. python windows 安装gensim

    安装gensim要确定numpy和scipy安装 再安装gensim

  3. windows 10安装gensim、nltk

    一.安装gensim 1.什么事gensim gensim是一个python的科学库,gensim包含了TF-IDF.随机投影.word2vec和document2vec算法的实现,分层Dirchle ...

  4. 如何在linux上有2个python的情况下安装gensim

    安装python的问题 https://blog.51cto.com/liqingbiao/2083869 安装gensim https://blog.csdn.net/zhujiyao/articl ...

  5. 安装gensim报错:Original error was: DLL load failed: 找不到指定的模块。 Command "python setup.py egg_info" failed with error code 1 in C:\Users\xubing\AppData\Local\Temp\pip-install-nta89iep\gensim\

    1.pip install --upgrade setuptools #安装或升级 2.如果是基于numpy的python 包,升级numpy pip install -U numpy 3.重新pip ...

  6. Anaconda 32在windows下安装gensim

    安装Anaconda 2.4以后运行corpora.MmCorpus.serialize的时候出错 换了Anaconda 2.1以后没问题了 原因:Anaconda 2.4的numpy是1.10.1版 ...

  7. mac 安装 gensim包出错

    安装时需要卸载scipy,结果显示 permission之类 加sudo也不行, 必须 得先disable 掉mac的SIP ,方法是重启系统 ,按住command+r ,进行recovers模式,然 ...

  8. python3.7 安装gensim使用word2Vec库

    应用的文章(个人试验过,完全正确):https://radimrehurek.com/gensim/index.html#install

  9. python安装numpy、scipy、gensim以及报错unable to import 'smart_open.gcs', disabling that module处理

    首先,安装gensim库,必须先安装numpy+mkl和scipy 安装顺序是依次安装numpy+kml.scipy.gensim,根据自己Python下载的版本进行下载 如果你的库里面有numpy. ...

随机推荐

  1. Math.round(),Math.ceil(),Math.floor()的区别

    1.Math.round():根据"round"的字面意思"附近.周围",可以猜测该函数是求一个附近的整数,看下面几个例子就明白. 小数点后第一位<5 正 ...

  2. MYSQL 主从复制(NIOT)

    一.主数据库操作设置(A) 1.修改配置文件,vim /etc/my.cnf,然后重启mysqld,/etc/init.d/mysqld restart [mysqld]<要在mysqld中括号 ...

  3. 新建HomeController控制器 继承BaseController

    CRC这个缩略词,在我看来可以有两种理解:一种是Cyclic Redundancy Check,即循环冗余检错技术:另一种则是Cyclic Redundance Code,即循环冗余校检码.在计算机网 ...

  4. iOS7之后的文本高度封装

    #import "NSString+Util.h" @implementation NSString (Util) +(CGFloat)changeStationWidth:(NS ...

  5. SQLite学习网址

    http://www.runoob.com/sqlite/sqlite-data-types.html

  6. javaWEB总结(15):jsp指令_page指令

    jsp指令 jsp指令是为jsp引擎设计的.他们并不直接产生任何可见输出,而只是告诉引擎如何处理jsp页面的其余部分. 目前定义了page,include和taglib这三种指令. page指令 (1 ...

  7. iOS开发Embedded dylibs/frameworks are only supported on iOS 8.0 and later for architecture armv7的解决方法

    全局搜索IPHONEOS_DEPLOYMENT_TARGE改为更小的版本

  8. MPI发送接收例子

    原文地址:http://blog.csdn.net/ziren235/article/details/1704203 #include"mpi.h" int main(int ar ...

  9. POJ 1067 取石子游戏(威佐夫博弈)

    传送门 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> ...

  10. 如何使用自定义消息?--ESFramework 4.0 快速上手(04)

    在ESFramework 4.0 快速上手一文中,我们讲述了如何使用Rapid引擎可以快速地上手ESFramework开发,文中介绍了使用ESPlus.Application.CustomizeInf ...