Windowsです。PythonでMeCabを使いたいです。
ダウンロード+インストールして使えていましたが
理由が分からないままエラーが出るようになりました。
辞書はunidicを使いたいです。
バージョンは
mecab 0.996.3
mecab-python3 1.0.8
python 3.10
unidic 1.1.0
です。
microsoft visual c++をダウンロード+インストールしました。
unidicのダウンロード+インストールしました。
import MeCab m=MeCab.Tagger()
に対してエラーが
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\MeCab\__init__.py:137, in Tagger.__init__(self, rawargs) 136 try: --> 137 super(Tagger, self).__init__(args) 138 except RuntimeError as ee: RuntimeError: The above exception was the direct cause of the following exception: RuntimeError Traceback (most recent call last) Cell In [2], line 3 1 import MeCab ----> 3 m=MeCab.Tagger() File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\MeCab\__init__.py:139, in Tagger.__init__(self, rawargs) 137 super(Tagger, self).__init__(args) 138 except RuntimeError as ee: --> 139 raise RuntimeError(error_info(rawargs)) from ee RuntimeError: ---------------------------------------------------------- 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 ------------------------ arguments: default dictionary path: C:\Users\ユーザー\AppData\Local\Programs\Python\Python310\lib\site-packages\unidic\dicdir [ifs] no such file or directory: C:\Users\ユーザー\AppData\Local\Programs\Python\Python310\lib\site-packages\unidic\dicdir\mecabrc ----------------------------------------------------------
試してみたこと
・MeCabのダウンロード+インストールやり直し
・m=MeCab.Tagger("-Ochasen")で実行する
・辞書の指定をする
import MeCab
import unidic
m = MeCab.Tagger('-d /Program Files/MeCab/etc/unidic')
・パスの指定をする
C:\Program Files\MeCab\dic
等を行いましたが同じエラーが出ます。
・python -m unidic downloadは効きませんでした。
よろしくお願いいたします。

0 コメント