0

I am having the same problem as this and this.

I have installed R and rstudio through a conda environment which included r-rgl. I am now trying to install a package within R that requires rgl. However, calling library(rgl) gives the error

Error: package or namespace load failed for ‘rgl’:
 package ‘rgl’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version

I have tried to install rgl from within R, but then I get this message:

checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
* removing ‘/path/to/miniconda3/envs/my_conda_env/lib/R/library/rgl’
* restoring previous ‘/path/to/miniconda3/envs/my_conda_env/lib/R/library/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/vh/.../downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

The solution to the last error seems to be installing XQuartz in Mac, but I had it installed before. So I tried specifying install.packages("rgl", INSTALL_opts = "--with-libpng-prefix=/usr/X11/") but I still get the error above. Any suggestions? I'm quite lost now...

TL;DR: how do I connect my XQuartz installation with each conda environment that I create?

Sos
  • 1,783
  • 2
  • 20
  • 46
  • It sounds like you have installed a new version of `R` and possibly updated your macbook. Have you tried the suggestion on the cran installation page? (the use of X11 (including tcltk) requires XQuartz to be installed since it is no longer part of OS X. **Always re-install XQuartz when upgrading your macOS to a new major version.**) – Oliver Oct 03 '20 at 21:02
  • This sounds like a Conda problem; have you tried https://docs.conda.io/en/latest/help-support.html? – user2554330 Oct 05 '20 at 13:04
  • 1
    @Oliver, in the end, you were right. I do not understand how this was a problem, but re-installing XQuartz after update solved the problem – Sos Oct 07 '20 at 14:53

0 Answers0