2022年9月15日木曜日

PythonのMeCab使用でエラーが出る

 MeCabは日本語形態素解析システムの主要パッケージで、日本語解析によく使われます

しかしバージョンが合ってないとただimportしただけではエラーが出ます。


Python3の pip install mecab でエラーが出た場合は



$ pip install mecab-python3

$ pip install unidic-lite


でインストールしてください。


unidic-liteは辞書です。


----------------------------------------------------------


Failed initializing MeCab. Please see the README for possible solutions:


    https://github.com/SamuraiT/mecab-python3#common-issues


If you are still having trouble, please file an issue here, and include the

ERROR DETAILS below:


    https://github.com/SamuraiT/mecab-python3/issues


issueを英語で書く必要はありません。


------------------- ERROR DETAILS ------------------------


のようなエラーが出た場合は辞書がインストールされてません