fatal error C1083: Cannot open include file: 'mecab.h': No such file or directory

1k Views Asked by At

I tried installing the mecab-python-windows package both from source and via pip on a Windows 64-bit machine. I get the following error in both cases:

    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`

How can I deal with this error? Where could I find the mecab.h file and where should I place it? I would really appreciate any suggestion! Thank you!

1

There are 1 best solutions below

0
polm23 On

mecab-python-windows is not maintained, development has moved to mecab on PyPI. See here, which also mentions the error you are getting. It suggests you do this:

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

I would suggest you use mecab-python3.