搞乱“pahts”后在R中安装软件包时出错

时间:2017-07-05 13:44:15

标签: r macos

我试图在R中安装拨浪鼓包并收到此错误信息

configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package ‘RGtk2’

然后我尝试使用本指南解决RGtk2问题

http://marcoghislanzoni.com/blog/2014/08/29/solved-installing-rattle-r-3-1-mac-os-x-10-9/

我在Mac OS终端上尝试了这个代码(但这超出了我的理解):

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo port selfupdate
sudo port install pkgconfig
export PATH=/opt/pkgconfig/bin:$PATH
sudo port install gtk2 +x11
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig

它给了我这个答案

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
ad-mac0630:~ caruc35$ sudo port selfupdate
Password:
Sorry, try again.
Password:

并锁定。

我还安装了Apple的XCode命令行工具,并尝试了上面指南中的一些内容。它没有让拨浪鼓包工作,所以我删除了它。

在搞乱这个之后,拨浪鼓包仍然不起作用,R似乎不像以前那样工作。例如,我无法加载xlsx包,收到此错误消息:

    Loading required package: rJava
Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so':
  dlopen(/Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
  Referenced from: /Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so
  Reason: image not found
Error: package ‘rJava’ could not be loaded

试图改变PATH时,我是不是搞砸了?有没有办法重置一切恢复正常?

我尝试重新安装R但仍然会出现同样的问题。

0 个答案:

没有答案