CentOS 6.5:如何安装GTK 2.8.0版?

时间:2014-04-03 11:28:22

标签: r gtk centos rattle

我正在运行CentOS 6.5,kernel2.6.32-431.5.1.el6.x86_64#1 SMP。我正在尝试为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’
> 

1 个答案:

答案 0 :(得分:22)

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

yum groupinstall "Development Tools"
yum install gtk+-devel gtk2-devel