gpt4 book ai didi

python word2vec 没有安装

转载 作者:太空狗 更新时间:2023-10-29 21:22:15 27 4
gpt4 key购买 nike

我一直在尝试使用我的 Python2.7 解释器在我的 Windows 7 机器上安装 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 并将路径变量设置为安装中的 .exe 文件,任何建议将不胜感激,谢谢。

更新:

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

最佳答案

word2vec 适用于 Linux。请参阅:https://github.com/danielfrg/word2vec

在底部,它说有一个非常实验性的 Windows 版本位于:支持:https://github.com/zhangyafeikimi/word2vec-win32

编辑:

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

然后做:

from gensim.models import word2vec

关于python word2vec 没有安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25643004/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com