kanji koohii FORUM
Installing the MeCab Python Binding - Printable Version

+- kanji koohii FORUM (http://forum.koohii.com)
+-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html)
+--- Forum: Learning resources (http://forum.koohii.com/forum-9.html)
+--- Thread: Installing the MeCab Python Binding (/thread-3965.html)



Installing the MeCab Python Binding - dawhite - 2009-09-09

Has anyone ever done this?

I've been trying for the last two hours but it keeps telling me:

C:\Documents and Settings\Me\My Documents\Downloads\mecab-0.95\mecab-0.95>python
setup.py build
Traceback (most recent call last):
File "setup.py", line 14, in <module>
version = cmd1("mecab-config --version"),
File "setup.py", line 7, in cmd1
return os.popen(str).readlines()[0][:-1]
IndexError: list index out of range

When I try to install.

I don't know how I'm going to get it to work and it's almost unspeakably frustrating.


Installing the MeCab Python Binding - dawhite - 2009-09-09

Incidentally if any of you higher-level ninjas out there can translate this:

http://hdknr.spaces.live.com/Blog/cns!82BB74511E950AA4!1995.entry

that might help hugely.


Installing the MeCab Python Binding - radical_tyro - 2009-09-09

looks like you need to install mecab first. mecab python is just a wrapper. http://mecab.sourceforge.net/#download


Installing the MeCab Python Binding - dawhite - 2009-09-09

Thanks so much for the response!

Unfortunately, even after installing it, I keep getting the same error. This is possibly because mecab-config is nowhere to be found on my system. Could it be because it's the windows version? If so, am I SOL or what?


Installing the MeCab Python Binding - dawhite - 2009-09-09

Actually, I just discovered how kickass iKnow is for this. Mecab can go die.


Installing the MeCab Python Binding - Cacawate - 2011-10-01

Talk about a necrobump, but this post comes up in Google for a search of MeCab and Python.

Place the MeCab files in Python(maindir)\Lib\site-packages. Do NOT make a new folder for it. Now you should be able to work with it:

import MeCab

m = MeCab.Tagger ("-O wakati")
print m.parse("Japanese goes here.")

This will parse your input and output spaces in between the elements. If you try to use this in IDLE there is a chance you will get an unsupported char error, so make a .py file.