Rstudio and conda: GLIBCXX_3.4.30 not found

I get the following error when running library(stringi) and many other packages in RStudio. I do not get this error if I run R in the terminal.

>> library(stringi)
Error: package or namespace load failed for ‘stringi’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/user/miniconda3/envs/r-4.2/lib/R/library/stringi/libs/stringi.so':
  /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/user/miniconda3/envs/r-4.2/lib/R/library/stringi/libs/stringi.so)

More details on the setup.

RStudio 2022.07.2 is installed on the system. R 4.2.2 is installed in a conda environment.R and/or RStudio is always launched from the conda environment. Looking into the libstdc++.so.6 file, the version in the conda env is newer than that on the system.

libstdc++.so.6 on system:

🢒  strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29

libstdc++.so.6 in conda

🢒  strings miniconda3/lib/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
  • Seems like an RStudio problem since it works fine running R in the terminal and VS Code. I am not using the latest RStudio 2022.12.0 since it doesn't work with conda. The two older versions 2022.07.2 and 2022.02.4 seems to have this same problem. Why doesn't Rstudio just use the libstdc++.so.6 in the conda environment?
  • In the conda env, I cannot downgrade libstdc++.so.6 to match system because that breaks dependencies
  • On the system, I am not sure I can upgrade libstdc++.so.6 to more than what it is right now probably because it is running older focal Ubuntu 20.04 base. Maybe! Not sure.
  • I tried just softlinking libstdc++.so.6 from conda to system, but that breaks a lot of things
🢒  lsb_release -a
No LSB modules are available.
Distributor ID:	Zorin
Description:	Zorin OS 16.2
Release:	16
Codename:	focal

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.