Python pip3 pocketsphinx安装错误

时间:2017-08-04 05:44:44

标签: python-3.x anaconda 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

请帮我摆脱这个。

4 个答案:

答案 0 :(得分:3)

尝试此命令:

sudo apt-get install swig

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

答案 1 :(得分:1)

您是否安装了Swig?

我遇到了同样的问题,并在the PocketSphinx index at PyPI上看到其中一个要求是Swig,可以在http://www.swig.org/download.html下载(托管在SourceForge)并使用./configure && make && make install组合从源代码安装。
然后我继续从源代码安装PocketSphinx,但似乎问题是相同的,所以你可以尝试使用pip。

答案 2 :(得分:0)

尝试一下:

pip install pipwin
pipwin install pocketsphinx

答案 3 :(得分:0)

如果您使用的是 MacOSX ,请尝试使用此命令。

brew install swig