我一直试图使用Python2.7解释器在我的Windows7计算机上安装word2vec:https://github.com/danielfrg/word2vec
我已经尝试过从解压缩目录下载zip &运行python setup.py安装并运行pip install。但是,在这两种情况下,它都返回以下错误:
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行中,然后抛出这个错误:
'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/
发布于 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
那就做:
from gensim.models import word2vec发布于 2014-09-03 12:22:48
使用pip安装python库是一种很好的方法。
1.安装pip
( A)以管理员身份启动命令提示符
( B)下载get-pip.py,小心地将其保存为.py文件而不是.txt文件。然后,从命令提示符中运行它。
python get-pip.py
下载get-pip.py,并将其保存为get-pip.py(而不是get-pip.txt)。
从命令提示符中运行它。
python get-pip.py2.安装word2vec
现在您可以用
pip install word2vec发布于 2014-09-03 12:38:32
看起来这个包包含C代码并调用UN*X makefile,所以它不是为Windows编写的。您可以尝试找到预编译的Windows二进制文件。
https://stackoverflow.com/questions/25643004
复制相似问题