【发布时间】:2014-10-27 21:02:08
【问题描述】:
我一直在尝试使用我的 Python2.7 解释器在我的 Windows 7 机器上安装 word2vec:https://github.com/danielfrg/word2vec
我已尝试从解压缩的目录下载 zip 并运行 python setup.py install 并运行 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 并将路径变量设置为安装中的 .exe 文件,任何建议将不胜感激,谢谢。
更新:
虽然 word2vec 模块无法运行名为 genism 的包似乎运行良好,但它也有一些很棒的其他 NLP 功能 http://radimrehurek.com/gensim/
【问题讨论】:
标签: python pip gnuwin32 word2vec