您的位置:首页 > 大数据 > 人工智能

gensim安装http://blog.csdn.net/helihongzhizhuo/article/details/47038575

2015-07-29 11:59 555 查看
1、windows下的python和pip安装
http://blog.csdn.net/helihongzhizhuo/article/details/47038575
2、pip install gensim 安装gensim,理论上这样就能安装成功了,结果抛出错误如下:



 numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

  

  ----------------------------------------

  Failed building wheel for scipy



 numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

    

    ----------------------------------------

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZcDX4a/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-trjXT2-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZcDX4a/scipy

接下来开始了解决错误的漫漫长路

3、看错误scipy出错,以及各种查后说依赖 numpy,于是下载了numpy-1.9.2-win32-superpack-python2.7.exe 和 scipy-0.16.0b2-win32-superpack-python2.7.exe安装,结果一安装,扔出错,


python
version 2.7 required,which was not found in the registry

4、解决注册表找不到python2.7的问题

 方法:新建一个register.py 文件,把一下代码贴进去,保存



#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm #
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html 
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()




然后,命令窗口运行脚本文件:

加入注册表成功
5、分别安装 numpy-1.9.2-win32-superpack-python2.7.exe 和 scipy-0.16.0b2-win32-superpack-python2.7.exe 程序,均安装成功;
6、再次执行 pip install gensim 也成功,终于安装完成了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  gensim安装