【问题标题】:Installation problems with Gensim library Python 3.4 : http://www.lfd.uci.edu/~gohlke/pythonlibs/Gensim 库 Python 3.4 的安装问题:http://www.lfd.uci.edu/~gohlke/pythonlibs/
【发布时间】:2016-05-02 21:32:27
【问题描述】:

我已经安装了 2 个 python 库:

  1. NumPy - 1.10.4

  2. Scipy - 0.17.0

这是成功安装 gensim 所必需的,如:https://radimrehurek.com/gensim/install.html 中所述。我已经使用来自http://www.lfd.uci.edu/~gohlke/pythonlibs/ 的wheel 文件安装在带有python 3.4 的Windows 7 64 位机器上。我遇到了某些兼容性问题。

   C:\Users\888537>py -m pip install gensim-0.12.4-cp34-none-win_amd64.whl         
   Processing c:\users\888537\gensim-0.12.4-cp34-none-win_amd64.whl  
   Collecting numpy>=1.3 (from gensim==0.12.4)                                         
   Using cached numpy-1.11.0-cp34-none-win_amd64.whl                                
   Collecting smart-open>=1.2.1 (from gensim==0.12.4)                                
   Using cached smart_open-1.3.2.tar.gz                                              
   Complete output from command python setup.py egg_info:                          
   D:\Program Files\Python\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'install_requires'                                                   warnings.warn(msg)                                                            
   D:\Program Files\Python\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'test_suite'                                                         
   warnings.warn(msg)                                                            
   usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]                    
   or: -c --help [cmd1 cmd2 ...]                                                    
   or: -c --help-commands                                                          
   or: -c cmd --help                                                                                                                                            
   error: invalid command 'egg_info'                                                                                                                               ---------------------------------------- 

错误:命令“python setup.py egg_info”在 C:\Users\888537\AppData\Local\Temp\pip-build-7zxq63k_\smart-open\ 中失败,错误代码为 1

在 pip 安装过程中也会发生同样的情况:

Command "python setup.py egg_info" failed with error code 1 in C:\Users\888537\A
ppData\Local\Temp\pip-build-4o3kecba\gensim\

除了从 git repo 安装之外,还有其他方法吗?我也尝试从 git repo 导入失败。 :P

C:\Users\888537>py -m pip install -e git+ssh://git@github.com/piskvorky/gensim.g
it
--editable=git+ssh://git@github.com/piskvorky/gensim.git is not the right format
; it must have #egg=Package

【问题讨论】:

  • 为什么不能只使用pip install gensim?我现在已经尝试过了,我得到了 gensim==0.12.4
  • 我在pip安装过程中遇到的错误是:Command "python setup.py egg_info" failed with error code 1 in C:\Users\888537\A ppData\Local\Temp\pip-build- 4o3kecba\gensim\

标签: python git numpy scipy gensim


【解决方案1】:

你能试试这个吗?

pip install --upgrade setuptools

然后

pip install gensim

【讨论】:

  • 你好 Paul,“python setup.py egg_info”在 C:\Users\888537\A ppData\Local\Temp\pip-build-4o3kecba\gensim\ 中出现错误代码 1 失败是错误终止使用pip安装gensim包的代码。因此,pip安装不成功。
【解决方案2】:

我找到了我的问题的答案。pip-package gensim 安装失败,因为依赖项 httpretty 试图打印到非 UTF-8 语言环境,并且依赖项 SciPy 无法找到 OpenBLAS/Lapack-Libraries。 Reference:

我根据帖子尝试了解决此问题的步骤: Does Python SciPy need BLAS?

但是,我决定转向 Anaconda 使用 gensim 库编写代码。

【讨论】:

  • 在 Anacondas 中,gensim 库安装成功,只有一条语句“conda install gensim”,它安装了 httpretty 打印机和所有相关文件,以便一次性成功安装 gensim。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-09
  • 2015-08-08
  • 1970-01-01
相关资源
最近更新 更多