我在网上搜索过,特别是在Stackoverflow上已经完成了有关这方面的所有问题。
我使用以下命令安装它“pip install pocketsphinx”
我有windows x64, 我没有为Swig设置任何环境路径。
此外,我已下载Swig zip文件并将其解压缩到我的下载文件夹中,通过它搜索并且没有“swig.exe”文件。
您可以在下面的命令提示符中看到错误/日志。
C:\Users\User>pip install pocketsphinx
Collecting pocketsphinx
Using cached pocketsphinx-0.1.3.zip
Building wheels for collected packages: pocketsphinx
Running setup.py bdist_wheel for pocketsphinx ... error
Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-i770rcof\\pocketsphinx\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\User\AppData\Local\Temp\tmpgkhbp3u1pip-wheel- --python-tag cp36:
running bdist_wheel
running build_ext
building 'sphinxbase._ad' extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-i770rcof\\pocketsphinx\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\User\AppData\Local\Temp\pip-s5wxsxzb-record\install-record.txt --single-version-externally-managed --compile:
running install
running build_ext
building 'sphinxbase._ad' extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
error: command 'swig.exe' failed: No such file or directory
非常感谢任何帮助, 提前谢谢!
答案 0 :(得分:2)
好吧,我解决了。方法如下:
首先,我访问了他们的官方网站,并使用“swig.exe”文件专门为Windows下载了swigwin文件。
然后我将其解压缩,并将其添加到环境变量PATH中。这解决了我的问题。
之后我又得到了一个错误,它找不到visual studio C ++构建工具v14.0(沿着这些方向),如果你也有这个问题,从他们的官方网站下载C ++构建工具2015,安装,然后在你的程序文件中找到它或者什么,将路径复制到VC文件夹并将其添加到环境变量PATH中。
这允许我在windows上下载/安装pocketsphinx。
答案 1 :(得分:0)
如果您只想在Windows上安装pocketsphinx,那么您可以安装pocketsphinx的二进制文件。适合您系统的二进制文件可以在这里找到
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx
为您的系统选择正确的二进制文件,然后您可以使用以下命令
安装它python -m pip install pocketsphinx- downloaded_wheel .whl
答案 2 :(得分:0)
首先以管理员身份运行IDE或CMD并运行以下命令:
pip install pipwin
pipwin install pocketsphinx