12

我正在运行 CentOS 6.5,kernel2.6.32-431.5.1.el6.x86_64 #1 SMP。我正在尝试安装Rattle- R 编程语言的数据挖掘工具。Rattle 是从 R shell 安装的。尽管我安装了最新的 GTK,但在尝试安装 Rattle 时我得到了configure: error: GTK version 2.8.0 required(见下文)。如何解决这个问题?

R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

...
> library(rattle)
Rattle: A free graphical interface for data mining with R.
Version 3.0.4 r177 Copyright (c) 2006-2014 Togaware Pty Ltd.
Type 'rattle()' to shake, rattle, and roll your data.
> rattle()
The package 'RGtk2' is required to display the Rattle GUI. It does not
appear to be installed. This package (and its dependencies) can be
installed using the following R command:

install.packages('RGtk2')

This one-time install will allow access to the full functionality of
Rattle.

Would you like Rattle to install the package now? (yes/NO) yes
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/RGtk2_2.20.27.tar.gz'
Content type 'application/x-gzip' length 2785305 bytes (2.7 Mb)
opened URL
==================================================
downloaded 2.7 Mb

* installing *source* package ‘RGtk2’ ...
** package ‘RGtk2’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/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 ‘/usr/lib64/R/library/RGtk2’

The downloaded source packages are in
    ‘/tmp/RtmpJWMH35/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Error in rattle() : could not find function "gtkBuilderNew"
In addition: Warning messages:
1: In install.packages(pkg) :
  installation of package ‘RGtk2’ had non-zero exit status
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘RGtk2’
> 
4

1 回答 1

24

为了解决这个问题,必须安装gtk2开发库。在 CentOS 下,这可以通过以下方式完成:

yum groupinstall "Development Tools"
yum install gtk+-devel gtk2-devel
于 2014-04-04T10:33:57.480 回答