R中的软件包rgl无法在Mac OS中加载 [英] Package rgl in R not loading in Mac OS

查看:453
本文介绍了R中的软件包rgl无法在Mac OS中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在R(3.6.3)中安装了rgl软件包(0.104.16),但未加载.我没有任何错误.它只是永无休止地加载.我尝试重新安装R和RStudio以及Xquartz.什么都没用.我有Mac OS Catalina版本10.15.7.任何帮助将不胜感激!干杯

I installed the rgl package (0.104.16) in R (3.6.3), but it does not load. I don't get any errors. It just never ends loading. I tried reinstalling R and RStudio and also Xquartz. Nothing is working. I have Mac OS Catalina version 10.15.7. Any help would be highly appreciated! Cheers

推荐答案

已编辑以添加新的详细信息和建议的修补程序.

这似乎是由于2月初发布的2.8.0beta版本的Xquartz中的问题所致.有两个问题:

This appears to be due to problems in the 2.8.0beta version of Xquartz that was released in early February. There are two problems:

  • 它对 libX11.6.dylib 进行了不兼容的更改,因此为2.7.11版本构建的程序(例如 rgl 的CRAN二进制文件)不管用.如果您从源代码构建 rgl (以及其他所有使用X11的代码),那可能没问题-对我来说.

  • It makes incompatible changes to libX11.6.dylib, so programs (like the CRAN binaries of rgl) that were built for the 2.7.11 release will not work. If you build rgl (and everything else that uses X11) from source, it may be okay -- it was for me.

卸载时,它会留下两个在启动时运行的程序:/Library/LaunchDaemons/org.xquartz.startx.plist (在重新引导系统时运行)和/Library/LaunchAgents/org.xquartz.startx.plist (登录时运行).如果您随后安装2.7.11,则它们将无法运行(可能是由于上述libX11更改所致).到那时,X11中没有任何内容.

When you uninstall it, it leaves behind two programs that run at startup: /Library/LaunchDaemons/org.xquartz.startx.plist (runs when you reboot your system) and /Library/LaunchAgents/org.xquartz.startx.plist (runs when you login). If you then install 2.7.11, these will fail to run (probably because of the libX11 change mentioned above). At that point, nothing in X11 works.

因此解决方案似乎是:

  • 通过将XQuartz从 Applications/Utilities 文件夹拖到垃圾箱来卸载XQuartz.
  • 通过在R中运行 remove.packages("rgl"))来卸载 rgl .
  • /Library/LaunchDaemons /Library/LaunchAgents 中删除这两个名为 org.xquartz.startx.plist 的文件.
  • 重新启动系统以从这些文件中删除启动的进程.
  • 重新安装XQuartz 2.7.11.
  • 从CRAN或从源重新安装 rgl .
  • Uninstall XQuartz by dragging it from the Applications/Utilities folder to the trash.
  • Uninstall rgl by running remove.packages("rgl") in R.
  • Delete those two files named org.xquartz.startx.plist from /Library/LaunchDaemons and /Library/LaunchAgents.
  • Reboot your system to remove the processes started from those files.
  • Reinstall XQuartz 2.7.11.
  • Reinstall rgl either from CRAN or from source.

如果我错了并且该过程不起作用,只要您的 rgl 版本至少为0.105.12(但不会提供任何 rgl Windows):

If I'm wrong and that process doesn't work, this will almost certainly work as long as your rgl version is at least 0.105.12 (but won't give you any rgl windows):

# Start a new session
options(rgl.useNULL = TRUE)
library(rgl)

要查看显示,请运行 rglwidget()函数,它们将显示在浏览器或RStudio查看器窗格中.

To see your displays, run the rglwidget() function, and they'll display in a browser or the RStudio viewer pane.

这篇关于R中的软件包rgl无法在Mac OS中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆