LoginSignup
19
19

More than 5 years have passed since last update.

mecab-pythonをMacにインストールする

Posted at

すんなり行かなかったのでメモしておく。

mecabはbrewでインストールすると楽だった。
(後述のmecab-pythonが上手くインストールできず、試行錯誤の過程でコンパイルして入れちゃったけど)

$ brew install mecab
$ brew install mecab-ipadic

こっからが本番。mecab-pythonのインストール。
普通にeasy_install https://mecab.googlecode.com/files/mecab-python-0.996.tar.gzとかやると、
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command '/usr/bin/gcc' failed with exit status 1
ってエラーが出てくる。

上手くいかなくていろいろ調べた結果、環境変数をセットすると上手くいった。

$ wget https://mecab.googlecode.com/files/mecab-python-0.996.tar.gz
$ tar zxfv mecab-python-0.996.tar.gz
$ cd mecab-python-0.996
$
$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ python setup.py build
$ python setup.py install

おわり。

19
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
19