Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
20
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@wwacky

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

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

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

おわり。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
20
Help us understand the problem. What is going on with this article?