5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

installation of package 'rattle' had non-zero exit statusとなったとき

Last updated at Posted at 2017-05-11

統計の授業でrattleというパッケージが必要となったのでインストールしようとしましたが早速コケたのでメモ。

問題の概要

いつも通りinstall.package()を使ってインストールしたところ以下のようなエラーを吐いて止まった。

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'RGtk2' ...
** package 'RGtk2' successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... no
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package 'RGtk2'
* removing '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RGtk2'
Warning in install.packages :
  installation of package 'RGtk2' had non-zero exit status
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
ERROR: dependency 'RGtk2' is not available for package 'rattle'
* removing '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rattle'
Warning in install.packages :
  installation of package 'rattle' had non-zero exit status

何やらRGtk2というパッケージを入れようとしてコケてるみたいです。
これだけ別に入れてみます。

> install.package('RGtk2')
Package which is only available in source form, and may need compilation of C/C++/Fortran:
  'RGtk2'
Do you want to attempt to install these from sources?
y/n: y

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'RGtk2' ...
** package 'RGtk2' successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... no
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package 'RGtk2'
* removing '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RGtk2'
Warning in install.packages :
  installation of package 'RGtk2' had non-zero exit status

やはりコケますね。

対処法

エラーログの中に以下のように書いてあるので、どうやら先にGTKを入れなければならないようです。

checking for GTK... no
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package 'RGtk2

GTKとは、GTK+と呼ばれるGUIツールキットのことを指します。もともとGIMPを作るために開発されたものらしく、GNOMEプロジェクトに含まれるOSSです。

実際に行ったこと

私の環境は、以下のとおりです。

  • MacOS X 12.2 Sierra
  • R 3.4.0
$ brew install gtk+

これでGTK+のインストールは完了です。

ちなみに、Ubuntu等の場合は以下のコマンドでいけます。

$ sudo apt-get install libgtk2.0-dev

早速Rに戻ってrattleをインストールしてみましょう。

参考サイト

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?