首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python word2vec未安装

python word2vec未安装
EN

Stack Overflow用户
提问于 2014-09-03 11:20:13
回答 5查看 18.7K关注 0票数 10

我一直试图使用Python2.7解释器在我的Windows7计算机上安装word2vec:https://github.com/danielfrg/word2vec

我已经尝试过从解压缩目录下载zip &运行python setup.py安装并运行pip install。但是,在这两种情况下,它都返回以下错误:

代码语言:javascript
复制
Downloading/unpacking word2vec
  Downloading word2vec-0.5.1.tar.gz
  Running setup.py egg_info for package word2vec
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "c:\users\georgioa\appdata\local\temp\pip_build_georgioa\word2vec\setup.py", line 17, in <module>
        subprocess.call(['make', '-C', 'word2vec-c'])
      File "C:\Python27\lib\subprocess.py", line 524, in call
        return Popen(*popenargs, **kwargs).wait()
      File "C:\Python27\lib\subprocess.py", line 711, in __init__
        errread, errwrite)
      File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
        startupinfo)
    WindowsError: [Error 2] The system cannot find the file specified
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>
  File "c:\users\georgioa\appdata\local\temp\pip_build_georgioa\word2vec\setup.py", line 17, in <module>
    subprocess.call(['make', '-C', 'word2vec-c'])
  File "C:\Python27\lib\subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python27\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

访问subprocess.call()似乎有问题,所以在谷歌一下之后,我设法将shell=True添加到word2vec setup.py行中,然后抛出这个错误:

代码语言:javascript
复制
'make' is not recognized as an internal or external command,
operable program or batch file.
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running install
running build
running build_py
running install_lib
running install_data
error: can't copy 'bin\word2vec': doesn't exist or not a regular file 

老实说,我甚至不确定我该从这里去哪里。我也尝试过安装make并将path变量设置为安装中的.exe文件,任何建议都将不胜感激。

更新:

虽然word2vec模块不能工作--一个名为genism的包似乎运行得很好,但它还有其他一些很好的NLP功能-- http://radimrehurek.com/gensim/

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2016-03-09 19:25:17

word2vec是为Linux设计的。请参阅:https://github.com/danielfrg/word2vec

在底部,它说有一个非常实验性的Windows at: support:https://github.com/zhangyafeikimi/word2vec-win32

编辑:

看起来您还可以安装gensim:https://pypi.python.org/pypi/gensim

那就做:

代码语言:javascript
复制
from gensim.models import word2vec
票数 16
EN

Stack Overflow用户

发布于 2014-09-03 12:22:48

使用pip安装python库是一种很好的方法。

1.安装pip

( A)以管理员身份启动命令提示符

  1. 单击“开始”,单击“所有程序”,然后单击“附件”。
  2. 右键单击命令提示符,然后单击“以管理员身份运行”。
  3. 如果出现“用户帐户控制”对话框,请确认它显示的操作是所需的,然后单击“继续”。

( B)下载get-pip.py,小心地将其保存为.py文件而不是.txt文件。然后,从命令提示符中运行它。

python get-pip.py

下载get-pip.py,并将其保存为get-pip.py(而不是get-pip.txt)。

从命令提示符中运行它。

代码语言:javascript
复制
python get-pip.py

2.安装word2vec

现在您可以用

代码语言:javascript
复制
pip install word2vec
票数 1
EN

Stack Overflow用户

发布于 2014-09-03 12:38:32

看起来这个包包含C代码并调用UN*X makefile,所以它不是为Windows编写的。您可以尝试找到预编译的Windows二进制文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25643004

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档