Python pip3 pocketsphinx安装报错

新手上路,请多包涵

我在 python3 中安装 pocketsphinx 时遇到了这个问题

我正在使用 anaconda3,windows 10。

pip install –upgrade pocketsphinx

下面是我在安装 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 /home/geek/anaconda3/bin/python -u -c
     "import setuptools, tokenize;__file__='/tmp/pip-build-k634wg4p
     /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
      /tmp/tmp6ts477xjpip-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 -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include
    /sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig-
     outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i

     unable to execute 'swig': No such file or directory
      error: command 'swig' failed with exit status 1

 ----------------------------------------
 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 /home/geek/anaconda3/bin/python -u -c
 "import
 setuptools, tokenize;__file__='/tmp/pip-build-k634wg4p/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
/tmp/pip-q7w8xgtz-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 -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include
/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig
 -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
 unable to execute 'swig': No such file or directory
error: command 'swig' failed with exit status 1

请帮助我摆脱困境。

原文由 user7125048 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.4k
1 个回答

试试这个命令:

 sudo apt-get install swig

它安装了 swig,这是 pocketsphinx 的要求之一。

原文由 rajendra gurjar 发布,翻译遵循 CC BY-SA 4.0 许可协议