问题
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 ofrgl
) that were built for the 2.7.11 release will not work. If you buildrgl
(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 runningremove.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