Python pip3 pocketsphinx安装错误

问题描述 投票:1回答:2

我在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

请帮我摆脱这个。

python-3.x anaconda pocketsphinx
2个回答
3
投票

试试这个命令:

sudo apt-get install swig

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


1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.