简体   繁体   English

PocketSphinx 安装找不到 swig.exe

[英]PocketSphinx install can't find swig.exe

I have searched all over the web and especially have gone through all the questions regarding this here on Stackoverflow.我已经在整个网络上进行了搜索,尤其是在 Stackoverflow 上解决了与此相关的所有问题。

I am using the following command to install it "pip install pocketsphinx"我正在使用以下命令安装它“pip install pocketsphinx”

I have windows x64, I have not set any environmental paths regarding Swig.我有 windows x64,我没有设置任何关于 Swig 的环境路径。

Also I've downloaded Swig zip file and extracted it into my downloads folder, searched through it and there is no "swig.exe" file.此外,我已经下载了 Swig zip 文件并将其解压缩到我的下载文件夹中,搜索它并没有“swig.exe”文件。

Below you can see the error/log from the command prompt.您可以在下面从命令提示符看到错误/日志。

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

Any assistance is highly appreciated, thanks in advance!非常感谢任何帮助,提前致谢!

Alright, I solved it.好的,我解决了。 Here's how:方法如下:

First I went to their official website and downloaded the swigwin file specifically for windows with a “swig.exe” file.首先我去他们的官方网站下载了专门为windows设计的swigwin文件,里面有一个“swig.exe”文件。

Then I extracted it, and added it to the environment variable PATH.然后我将其解压,并将其添加到环境变量 PATH 中。 This solved my problem.这解决了我的问题。

Afterwards I got another error, it couldn't find visual studio C++ build tools v14.0 (along these lines), if you have this problem too just, download the C++ build tools 2015 from their official website, install, then find it in your Program Files or what ever, copy the path to the VC folder and add it to your environment variable PATH as well.后来我又遇到了一个错误,找不到visual studio C++ build tools v14.0(沿着这些线),如果你也有这个问题,从他们的官方网站下载C++ build tools 2015,安装,然后在您的程序文件或其他任何内容,将路径复制到 VC 文件夹并将其添加到您的环境变量 PATH 中。

This allowed me to download/install pocketsphinx on windows.这使我可以在 Windows 上下载/安装 Pocketsphinx。

First run your IDE or CMD as Administrator and run the following:首先以管理员身份运行您的 IDE 或 CMD 并运行以下命令:

pip install pipwin
pipwin install pocketsphinx

If you just want to install pocketsphinx on windows, then you can install binary of pocketsphinx.如果你只是想在 windows 上安装 pocketsphinx,那么你可以安装 pocketsphinx 的二进制文件。 The binaries suited to your system can be found here可以在此处找到适合您系统的二进制文件

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx

Chose right binary for your system and then you can install it using following command为您的系统选择正确的二进制文件,然后您可以使用以下命令安装它

python -m pip install pocketsphinx‑ downloaded_wheel .whl python -m pip install pocketsphinx- downloaded_wheel .whl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM