安装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. ...
随机推荐
- Openjudge-NOI题库-字符串移位包含问题
题目描述 Description 对于一个字符串来说,定义一次循环移位操作为:将字符串的第一个字符移动到末尾形成新的字符串. 给定两个字符串s1和s2,要求判定其中一个字符串是否是另一字符串通过若干次 ...
- QCMediaPlayer mediaplayer NOT present(android)
出现了“QCMediaPlayer mediaplayer NOT present”这个错误!!!我的手机是小米手机2,我给它刷机刷到了Android 4.4.4,后来我学长是这样解决的:case R ...
- ubuntu enable all Ubuntu software (main universe restricted multiverse) repositories use
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe ...
- 使用SQL Server临时表来实现字符串合并处理
处理的数据 CREATE TABLE tb(col1 varchar(10),col2 int) INSERT tb SELECT 'a',1 union ALL SELECT 'a',2 union ...
- Xcode好用的插件(随时更新)
古人云"工欲善其事必先利其器",打造一个强大的开发环境,是立即提升自身战斗力的绝佳途径!下面简单介绍下插件是什么.如何使用Xcode插件以及一些常用的Xcode插件的推荐. 一.插 ...
- android studio导入第三方源码模块
从网上得到的但三方源码模块,如果直接导入到自己的项目里的时候,可能需要比较长的时间,甚至不成功. 在导入之间,还是应该将模块里的 build.gradle 编辑一下,使其与自己的android stu ...
- Linux Date命令学习笔记
date 根据给定格式显示日期或设置系统日期时间.print or set the system date and time 指令所在路径:/bin/date 命令参数: 参数 描述 -d 显示字符串 ...
- 用两个栈实现队列,剑指offer P59
public class QueueByStack { private Stack<Integer> stack1; private Stack<Integer> stack2 ...
- 云信推送通知 APN invalid Token
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #e4af09; min-height: 14.0px } ...
- SQL优化 总结 精简
索引: 考虑在 where 及 order by 涉及的列上建立索引 经常同时存取多列,且每列都含有重复值可考虑建立组合索引,且查询越频繁的字段放前面 按需使用聚集与非聚集索引,聚集不适合频繁更新.适 ...