11

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

0

3 Answers 3

16

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.

Sign up to request clarification or add additional context in comments.

9 Comments

this seems to work when installing the rgl package "manually". but is there a way to implement this solution when rgl is installed as a dependency during the R_CMD_check of Github Actions? (sorry if this is a dumb question)
@yasel: set environment variable RGL_USE_NULL: true in the env: section of your action, and it won't be an issue.
how do I find Applications/Utilites to deleted Quartz on a Mac? Or put differently: how shall I know where this file is if I cannot even find it on my computer. I am pretty sure it causes my current problems.
@canIchangethis: 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.
Oh thanks! I found it - for some reason it was named different in my mac's language
|
2

I installed XQuartz 2.8.5, restarted my M1 Mac, and i could install and run the rayshader demo. the problem apparently was that rgl had x386 libraries but not ARM ones (or at least aliases to them), but installing the latest XQuartz fixed that without having to fiddle with removing files

Comments

0

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!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.