mecab icon indicating copy to clipboard operation
mecab copied to clipboard

mecab-python causes RuntimeError on Windows64bit/Python3 environment

Open icoxfog417 opened this issue 9 years ago • 3 comments

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.

icoxfog417/mecab#windows

But any fix does not work (in addition, It works fine on 32bit).

icoxfog417 avatar Oct 02 '15 00:10 icoxfog417

Maybe you have not yet installed the dictionary mecab-ipadic-2.7.0-XXXX.tar.gz?

BoeingX avatar Apr 02 '17 10:04 BoeingX

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.

icoxfog417 avatar Apr 03 '17 00:04 icoxfog417

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.

shekharkoirala avatar Dec 18 '18 05:12 shekharkoirala