適当な思いつきで書くブログ

UbuntuやPerlやJavaScriptやVimやZshやShellScriptやMySQLと戯れている中で適当な思いつきでやってみたことを書いています。

Ubuntu11.04環境でgm-notifyが起動しないときの対処法

4/28にUbuntu11.04が正式リリースされました。さっそく新しいUnityインタフェースに慣れず、Ubuntuクラシックに逃げました...


さて、GMail Notifier(gm-notify)というpython製のGmailのメールチェッカーがあります。Ubuntu10.10の頃から利用していたのですが、素のUbutu11.04環境では動作しませんでした。
下記のように Twisted と python2.7-dev のインストールが必要となります。


まずは gm-notify をインストールします。

$ wget http://launchpad.net/gm-notify/0.x/0.10.3/+download/gm-notify-0.10.3.tar.gz
$ tar xvf gm-notify-0.10.3.tar.gz
$ cd gm-notify-0.10.3
$ sudo python setup.py install

インストールは完了しますが、メニューから「GMail Notifier Configuration」を選択しても起動しません。

ログを覗いてみるとこのようになっていました。

$ less ~/.xsession-errors
Traceback (most recent call last):
  File "/usr/local/bin/gm-notify-config", line 36, in <module>
    from twisted.words.protocols.jabber import jid
ImportError: No module named words.protocols.jabber

words.protocols.jabber がなさそうなのでまずは Twisted をインストールします

$ wget http://twistedmatrix.com/Releases/Twisted/11.0/Twisted-11.0.0.tar.bz2
$ tar xvf Twisted-11.0.0.tar.bz2
$ cd Twisted-11.0.0
$ sudo python setup.py install
fatal error: Python.h: No such file or directory

今度は Python.h がないと言われますので、さらにaptitudeで python2.7-dev をインストールします

$ sudo aptitude install python2.7-dev

再度、Twisted をインストールすると正常に完了しました

$ sudo python setup.py install

以上を行なうことでgm-notifyを起動することができました。