mecab
mecab copied to clipboard
mecab-python causes RuntimeError on Windows64bit/Python3 environment
I tried to use mecab-python
on Windows, but it causes RuntmeError (Python version is 3.4
).
>>> import MeCab
>>> t = MeCab.Tagger()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Develop\Source\mecab\mecab\python\MeCab.py", line 433, in __init__
this = _MeCab.new_Tagger(*args)
RuntimeError
- I used the code on GitHub master base (mecab/mecab/python).
- I attached the fix for windows (refer this site etc).
- I tried to regenerate binding code by swig (used swig 3.0.7)
Below is the patched branch that I used.
But any fix does not work (in addition, It works fine on 32bit).
Maybe you have not yet installed the dictionary mecab-ipadic-2.7.0-XXXX.tar.gz
?
The dictionary is already installed (as I described above, same setup works fine on 32bit environment).
But because of bash on Windows feature is released recently, I'm not in trouble by this issue.
Download , mecab-ipdaic-neologd dictionary
git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
cd mecab-ipadic-neologd
./bin/install-mecab-ipadic-neologd -n
echo mecab-config --dicdir
"/mecab-ipadic-neologd"
/usr/local/lib/mecab/dic/mecab-ipadic-neologd
Other than this is confirmation of not proper path of dictionary. mecab -D Here is my error , the dict is in another path. Error: param.cpp(69) [ifs] no such file or directory: /usr/local/lib/mecab/dic/ipadic/dicrc
But this is working : echo "8月3日に放送された「中居正広の金曜日のスマイルたちへ」(TBS系)で、1日たった5分でぽっこりおなかを解消するというダイエット方法を紹介。キンタロー。のダイエットにも密着。" | mecab -d /usr/local/lib/mecab/dic/mecab-ipadic-neologd
Reason is , the path is working. So Final step : locate mecabrc dicdir = /usr/local/lib/mecab/dic/mecab-ipadic-neologd
To every file found, replace the value of dicdir.