我在整个网络上进行了搜索,尤其是在 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
非常感谢任何帮助, 提前致谢!
请您参考如下方法:
好的,我解决了。方法如下:
首先我去了他们的官网,下载了windows专用的swigwin文件,里面有一个“swig.exe”文件。
然后我解压出来,添加到环境变量PATH中。这解决了我的问题。
后来又报错了,找不到visual studio C++ build tools v14.0(顺着这几行),如果你也有这个问题,就去官网下载C++ build tools 2015,安装,然后在您的 Program Files 或其他任何地方找到它,将路径复制到 VC 文件夹并将其添加到您的环境变量 PATH 中。
这让我可以在 Windows 上下载/安装 pocketsphinx。
