安装gensim
安装了一天的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的更多相关文章
- Linux下安装Gensim
依赖软件包:numpy 直接使用pip安装: [root@mycentos ~]#pip install gensim 安装gensim的时候会遇到下面的一系列错误: Cannot uninstall ...
- python windows 安装gensim
安装gensim要确定numpy和scipy安装 再安装gensim
- windows 10安装gensim、nltk
一.安装gensim 1.什么事gensim gensim是一个python的科学库,gensim包含了TF-IDF.随机投影.word2vec和document2vec算法的实现,分层Dirchle ...
- 如何在linux上有2个python的情况下安装gensim
安装python的问题 https://blog.51cto.com/liqingbiao/2083869 安装gensim https://blog.csdn.net/zhujiyao/articl ...
- 安装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 ...
- Anaconda 32在windows下安装gensim
安装Anaconda 2.4以后运行corpora.MmCorpus.serialize的时候出错 换了Anaconda 2.1以后没问题了 原因:Anaconda 2.4的numpy是1.10.1版 ...
- mac 安装 gensim包出错
安装时需要卸载scipy,结果显示 permission之类 加sudo也不行, 必须 得先disable 掉mac的SIP ,方法是重启系统 ,按住command+r ,进行recovers模式,然 ...
- python3.7 安装gensim使用word2Vec库
应用的文章(个人试验过,完全正确):https://radimrehurek.com/gensim/index.html#install
- python安装numpy、scipy、gensim以及报错unable to import 'smart_open.gcs', disabling that module处理
首先,安装gensim库,必须先安装numpy+mkl和scipy 安装顺序是依次安装numpy+kml.scipy.gensim,根据自己Python下载的版本进行下载 如果你的库里面有numpy. ...
随机推荐
- 将LibreOffice文档批量转成PDF格式
使用如下命令可以将文档一次性批量导出为pdf格式: -name -I /program/soffice.exe --headless --convert-to pdf '{}' find命令的-max ...
- 【ubuntu】开机启动
背景 在ubuntu下做开发,虚拟机要经常开启和关闭,重要的进程需要随机自启,非重要的可以手工启动.比如nginx就需要自启,confluence就没那么重要了. 为了控制哪些程序要自启,哪些程序不要 ...
- servlet的url-pattern匹配规则
首先需要明确几容易混淆的规则: servlet容器中的匹配规则既不是简单的通配,也不是正则表达式,而是特定的规则.所以不要用通配符或者正则表达式的匹配规则来看待servlet的url-pattern. ...
- 【JS】学习18天Jquery Moblie的总结笔记。
现在是2013年11月18日1:53分,从1号开始学习JqueryMoblie(简称JQM),这些天遇到的问题,和走的弯路还真不少. 先做个小总结,做了那么多天的一些收获: ●JQM是一个手机网站/轻 ...
- android源码查看所有分支切换分支
cd .repo/manifests git branch -a repo init -b android-4.1.2_r1 repo sync
- Arrar.prototype.map()的用法
---恢复内容开始--- map() 方法返回一个由原数组中的每个元素调用一个指定方法后的返回值组成的新数组. array.map(callback[, thisArg]) 注:[]在语法中[]内的内 ...
- MongoDB高级查询用法大全
转载 http://blog.163.com/lgh_2002/blog/static/440175262012052116455/ 详见官方的手册: http://www.mongodb.org/d ...
- 对adapter的封装优化
一般不优化的adapter通常继承自BaseAdapter会出现一下几个问题: getCount(), getItem(), getItemId()代码都要去重写,一个adapter还行,如果adap ...
- 手机浏览器无法获取COOKIE的原因
手机浏览器上无法使用cookie,肯能是 1. 浏览器禁用 COOKIE ,这个简单开启即可. 2. 可能是手机所在时区有问题,将COOKIE有效期设置更长时间测试下,在更改时区
- CodeForces 699A Launch of Collider
枚举相邻两个$a[i]$与$a[i+1]$,如果$s[i]=R$并且$s[i+1]=L$,那么$i$和$i+1$会碰撞,更新答案. #pragma comment(linker, "/STA ...