当我尝试安装RGtk2包时,我得到以下错误:
> install.packages("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 package ‘RGtk2’
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
* 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
The downloaded source packages are in
‘/private/var/folders/m4/l02774c51vx71qt6_wdq59lw0000gn/T/Rtmpa7sxIS/downloaded_packages’
>
我运行的是macOS西拉(10.12.4版)和R 3.4.0版。
发布于 2017-10-15 03:28:08
我假设您已经安装了R和RStudio。如果没有,请安装它。然后执行以下操作。
1)安装XQuartz
2)安装GTK 2.24.17-X11
3)下载cairoDevice和RGtk2
4)从终端运行R CMD INSTALL ~/Downloads/cairoDevice_2.24.tar.gz
5)安装Homebrew for Mac。
6)在终端输入以下命令:brew uninstall cairo --ignore-dependencies brew install --with-x11 cairo
7)在终端中键入brew edit gtk+并滚动到def install部分,并使用quartz编辑引用(按i编辑并保存并退出,按semi键并键入冒号(shift+分号键)。然后键入wq。)
"--with-gdktarget=x11", "--enable-x11-backend"
8)然后在同一终端窗口中输入brew install --build-from-source --verbose gtk+。
9)然后输入export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig/gtk+-2.0.pc:/opt/X11/lib/pkgconfig
10)在同一终端窗口中输入R CMD INSTALL ~/Downloads/RGtk2_2.20.33.tar.gz。
希望它能为你工作。
发布于 2017-05-17 07:58:25
您的系统中可能没有安装GTK (R之外)。您可以尝试从位于../libs/目录中的GTK包进行安装:
http://r.research.att.com/libs/ 可能首先需要适合您的macOS版本的XQuartz、Xcode和正确的命令行工具。bash-install的下载和安装代码位于/libs/页面的底部。
发布于 2017-11-04 19:10:51
当我尝试安装RGtk2时,出现了...我检查了which gcc,它显示了一个c编译器。为什么它说C编译器不工作?
$ R CMD INSTALL ~/Downloads/RGtk2_2.20.33.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
* 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... yes
checking for GTHREAD... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/xh/kw0cr4xj52zd9pd8t46d6xwh0000gn/T/RtmpnYEC6D/R.INSTALL13a7b3357df80/RGtk2':
configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package ‘RGtk2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RGtk2’https://stackoverflow.com/questions/44013379
复制相似问题