2017-07-26 83 views
1

我一直无法在我的Mac上安装“拨浪鼓”。试图单独安装软件包,尝试安装依赖设置为true,但都没有用。我已经安装了Xquartz,编译器等。安装“拨浪鼓”包时出错

如果有人能指出我正确的方向,我会很感激。谢谢!

> version 
       _       
platform  x86_64-apple-darwin15.6.0 
arch   x86_64      
os    darwin15.6.0     
system   x86_64, darwin15.6.0   
status          
major   3       
minor   4.1       
year   2017       
month   06       
day   30       
svn rev  72865      
language  R       
version.string R version 3.4.1 (2017-06-30) 
nickname  Single Candle    
> 
> install.packages("rattle") 
also installing the dependency ‘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 
installing the source packages ‘RGtk2’, ‘rattle’ 

trying URL 'https://cran.rstudio.com/src/contrib/RGtk2_2.20.33.tar.gz' 
Content type 'application/x-gzip' length 2792938 bytes (2.7 MB) 
================================================== 
downloaded 2.7 MB 

trying URL 'https://cran.rstudio.com/src/contrib/rattle_4.1.0.tar.gz' 
Content type 'application/x-gzip' length 2665410 bytes (2.5 MB) 
================================================== 
downloaded 2.5 MB 

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

The downloaded source packages are in 
    ‘/private/var/folders/1n/3vkxyt2j5c58wnq85_lsn24w0000gn/T/RtmpvykPQP/downloaded_packages’ 
> 

这是我所得到的,当我尝试安装RGTK2:

Rgtk.c:7:10: fatal error: 'gdk/gdkx.h' file not found 
#include <gdk/gdkx.h> 
     ^
1 error generated. 
make: *** [Rgtk.o] Error 1 
ERROR: compilation 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 

The downloaded source packages are in 
    ‘/private/var/folders/1n/3vkxyt2j5c58wnq85_lsn24w0000gn/T/RtmpvykPQP/downloaded_packages’ 
+0

您需要先安装GTK,[见这里](http://www.ggobi.org/rgtk2/)。 –

+0

@RemkoDuursma感谢您的提示,但没有为我工作。 – JohnWayne360

+1

请详细说明。你能不能安装GTK或不解决问题? GTK是否可用? –

回答

-1

我尝试了几种方法来下载拨浪鼓包,但只有以下方法处理!

尝试install.packages("Cairo Device")

应该与它一起安装的拨浪鼓包。

-2

当我以多种方式安装拨浪鼓包,例如直接通过开罗设备安装拨浪鼓时,我遇到了同样的错误。但现在已经修复了。我所做的是以下几点:

我在我的Mac中有3.4.3版本。所以,我已经从Cran-R下载了3.3.3版本的R,只是运行安装(没有任何其他更改),然后重新启动我的Mac。 当我推出R Studio时,Rattle就在那里。

P.S .:总是安装-1版本的最新软件,而不是立即升级到最新版本(除非它是绝对必要的)。