安装pocketsphinx python 模块:命令'swig.exe' 失败 [英] Installing pocketsphinx python module: command 'swig.exe' failed
问题描述
我得到了这样的东西.谁能告诉我如何解决这个问题.
I'm getting something like this. Can anyone please tell me how to fix this.
C:\Users\krush\Documents\ML using Python>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: started
Running setup.py bdist_wheel for pocketsphinx: finished with status 'error'
Complete output from command C:\Users\krush\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krush\\AppData\\Local\\Temp\\pip-build-cns2i_wb\\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\krush\AppData\Local\Temp\tmp3tyvnl9wpip-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: started
Running setup.py install for pocketsphinx: finished with status 'error'
Complete output from command C:\Users\krush\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krush\\AppData\\Local\\Temp\\pip-build-cns2i_wb\\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\krush\AppData\Local\Temp\pip-x5mxeczy-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
----------------------------------------
Command "C:\Users\krush\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krush\\AppData\\Local\\Temp\\pip-build-cns2i_wb\\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\krush\AppData\Local\Temp\pip-x5mxeczy-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\
推荐答案
为了解决这个问题,我下载了 windows swig
To fix the problem, I downloaded swig for windows
将 swig.exe 复制到 python 安装文件夹(例如 C:/python27)
Copy swig.exe to the python installation folder (for ex C:/python27)
打开swigwin-3.0.12/Lib
文件夹,复制所有*.swg
文件到C:/python27/Lib
代码>或等效的python路径
Open the swigwin-3.0.12/Lib
folder and copy all *.swg
files to the C:/python27/Lib
or equivalent python path
打开swigwin-3.0.12/Lib/python
,将所有文件复制到C:/python27/Lib
Open swigwin-3.0.12/Lib/python
and copy all the files to C:/python27/Lib
打开swigwin-3.0.12/Lib
文件夹并将typemaps
文件夹复制到C:/python27/Lib
Open the swigwin-3.0.12/Lib
folder and copy over the typemaps
folder to C:/python27/Lib
(还要确保你安装了 Microsoft Visual C++ Compiler for Python)
(Also make sure you have Microsoft Visual C++ Compiler for Python installed)
这些步骤对我有用.
这篇关于安装pocketsphinx python 模块:命令'swig.exe' 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!