Back

Installing the MeCab Python Binding

#1
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.
Reply
#2
Incidentally if any of you higher-level ninjas out there can translate this:

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

that might help hugely.
Reply
#3
looks like you need to install mecab first. mecab python is just a wrapper. http://mecab.sourceforge.net/#download
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
#4
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?
Reply
#5
Actually, I just discovered how kickass iKnow is for this. Mecab can go die.
Reply
#6
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.
Reply