Package rgl in R not loading in Mac OS

依然范特西╮ 提交于 2021-02-17 06:43:31

问题


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


回答1:


Edited to add new details and suggested fixes.

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:

  • 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.

  • 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.

So the solution appears to be:

  • 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.

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)

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



来源:https://stackoverflow.com/questions/66011929/package-rgl-in-r-not-loading-in-mac-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!