首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装pocketsphinx模块:命令“swig.exe”失败

安装pocketsphinx模块:命令“swig.exe”失败
EN

Stack Overflow用户
提问于 2017-06-12 16:59:06
回答 12查看 53.4K关注 0票数 22

我会得到这样的东西。谁能告诉我怎么解决这个问题吗。

代码语言:javascript
运行
复制
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\
EN

回答 12

Stack Overflow用户

回答已采纳

发布于 2018-05-01 14:09:04

为了解决这个问题,我在写这个答案时下载了抢购车窗,它是3.0.12

有关最新的swig windows版本,请按以下链接操作

  1. 将swig.exe复制到python安装文件夹(用于ex C:/python 27)
  2. 打开swigwin-3.0.12/Lib文件夹并将所有*.swg文件复制到C:/python27/Lib或等效的python路径
  3. 打开swigwin-3.0.12/Lib/python并将所有文件复制到C:/python27/Lib
  4. 打开swigwin-3.0.12/Lib文件夹并将typemaps文件夹复制到C:/python27/Lib

(还要确保安装了)

这些步骤对我有效。

票数 30
EN

Stack Overflow用户

发布于 2019-09-28 08:16:37

代码语言:javascript
运行
复制
conda install swig
pip install pocketsphinx

我不想做所有其他人建议的设置,所以我尝试了这个,而且成功了。不过,这可能只有在您使用Anaconada时才能起作用。

票数 27
EN

Stack Overflow用户

发布于 2018-09-14 09:54:00

您可以将Swig的位置添加到环境变量中,而不是将Swig文件复制到Python文件夹中:

  1. Ctrl+S
  2. 类型env和按下Enter
  3. 双击Path
  4. 将路径到Swig添加到最后一个空行。
  5. 单击OK并重新启动您的PC
票数 25
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44504899

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档