簡體   English   中英

PocketSphinx 安裝找不到 swig.exe

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

我已經在整個網絡上進行了搜索,尤其是在 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,安裝,然后在您的程序文件或其他任何內容,將路徑復制到 VC 文件夾並將其添加到您的環境變量 PATH 中。

這使我可以在 Windows 上下載/安裝 Pocketsphinx。

首先以管理員身份運行您的 IDE 或 CMD 並運行以下命令:

pip install pipwin
pipwin install pocketsphinx

如果你只是想在 windows 上安裝 pocketsphinx,那么你可以安裝 pocketsphinx 的二進制文件。 可以在此處找到適合您系統的二進制文件

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

為您的系統選擇正確的二進制文件,然后您可以使用以下命令安裝它

python -m pip install pocketsphinx- downloaded_wheel .whl

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM