安装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. ...
随机推荐
- 一个初学者的辛酸路程-FTP-9
前言 今天,我要描述一个FTP的故事 主要内容 嗯,今天主要以阶梯性的形式来做一个FTP项目. 第一步: 我要实现这么一个功能,一个FTP客户端,1个FTP服务端,2端建立连接以后可以进行通讯. 服务 ...
- .net 获取类型的Type类型的几种方法
一:使用Object基类的GetType()方法 Car car = new Car(); Type carType = car.GetType(); 二:使用typeof操作符 Type carTy ...
- java运行时数据区域
数据区域有:程序计步器,虚拟机栈,本地方法栈,java堆,方法区 程序计步器: 它是一块较小的内存空间,它的作用可以看做是当先线程所执行的字节码的信号指示器. 每一条JVM线程都有自己的PC寄存器,各 ...
- Enhancing Reliability and Response Times via Replication in Computing Clusters---INFOCOM 2015
[标题] Enhancing Reliability and Response Times via Replication in Computing Clusters [作者] Zhan Qiu an ...
- Linux常用命令汇总及使用方法(三)
(1)文件管理命令 ls.ls -l.ll.ls -a ls -a 显示所有文件,包括隐藏文件 ls 列举指定目录下的子目录和文件 ls -l与ll相同 列举指定目录下的子目录和文件的详细信息 tot ...
- [笔记]The Linux command line
Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...
- php curl 抓取内容
<?php$ch=curl_init(); curl_setopt($ch,CURLOPT_URL,$url)//抓取url curl_setopt($ch,CURLOPT_RETURNTRAN ...
- 使用MegaCli工具,在线调整raid配置
公司hadoop平台采购了一批浪潮服务器,2个系统盘,12个数据盘.先想的用直通的raid卡免得再做单盘raid0麻烦,结果这批机器配的卡也不支持裸盘使用,咨询浪潮客服,说可以使用JBOD的模式进行, ...
- oracle 行专列
首先,做准备工作. 建表 -- Create table create table DEMO ( n_iden NUMBER, c_order_code NVARCHAR2(), c_order_na ...
- 使用PHP连接redis后,timeout连接太多的解决方案
这个问题,大家在使用php redis之后肯定都会遇到.所以本菜本着虚心求教的原则,又在网上四处求教.得到的答案,无非是以下两种: 1.redis没有主动close. 事后发现,这个答案纯属以讹传讹, ...