【问题标题】:fatal error C1083: Cannot open include file: 'mecab.h': No such file or directory致命错误 C1083:无法打开包含文件:'mecab.h':没有这样的文件或目录
【发布时间】:2021-07-21 11:32:15
【问题描述】:

我尝试在 Windows 64 位机器上从源代码和通过 pip 安装 mecab-python-windows 包。在这两种情况下我都会收到以下错误:

    MeCab_wrap.cxx(3137): fatal error C1083: Cannot open include file: 'mecab.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2`

我该如何处理这个错误?我在哪里可以找到 mecab.h 文件,我应该把它放在哪里?我真的很感激任何建议!谢谢!

【问题讨论】:

    标签: python mecab


    【解决方案1】:

    mecab-python-windows 未维护,开发已移至 PyPI 上的 mecab。请参阅here,其中还提到了您遇到的错误。它建议您这样做:

    CPLUS_INCLUDE_PATH=`python-config --prefix`/Headers:$CPLUS_INCLUDE_PATH pip install mecab
    

    我建议你使用 mecab-python3。

    【讨论】:

      猜你喜欢
      • 2011-12-09
      • 2011-09-23
      • 2019-05-30
      • 2010-09-09
      • 2013-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多