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
3 Answers
Edited in Nov 2025 to add new details and suggested fixes.
Failure to load rgl in macOS Tahoe 26.1 is due to some changes in that OS, with no corresponding update to the XQuartz system. I don't know of any remedy for it. Apple announced several years ago that it was dropping support for OpenGL, and that appears to have happened.
The rglwidget() workaround described below will still work in Tahoe, so that's your only option (other than reverting to macOS Sequoia, which is a risky proposition: you need to trust a full backup from before the upgrade to Tahoe, because part of reverting includes wiping your main disk of all data.)
If you are using an older version of macOS and see the load failures, there may be remedies.
The most common cause in pre-Tahoe macOS versions is a problem with XQuartz. Installing XQuartz 2.8.5 seems to be reliable. You may need to reinstall it after an OS change.
If that doesn't work (or you are using Tahoe) then you can still use rgl with the following workaround:
# 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. This can be triggered automatically by running
options(rgl.printRglwidget = TRUE) This causes printing of any rgl function result to trigger a browser display.
The rglwidget() workaround often gives a nicer display than the built-in display, but some functions are not supported: rgl.snapshot() and select3d() are the main ones. Callbacks are handled differently; see the help pages for those.
9 Comments
RGL_USE_NULL: true in the env: section of your action, and it won't be an issue.Applications is normally listed in the Finder as a "favorite". If it's not there, it should be in /Applications in the root directory of your main drive. Applications/Utilities is a folder within it.I don't know if anyone will see this, but I got an error message in R studio and it gave me a link to this issue here. I was able to solve it by:
going into my terminal ->
running | brew cleanup (brew install --cask xquartz | will work as well since it runs the cleanup if it notices you haven't updated in a certain amount of time) ->
Pressing command & space to bring up the search bar, look for the xquartz app and click to run it in the background.
TLDR: For some reason, idk why, I have to manually open the xquartz app and have it running in the background as an app to use rgl. Install it/restart it with homebrew. Hope this helps!