Skip to content
Advertisement

R reticulate libstdc++so GLIBCXX_3.4.21 not found issue

I was trying to use pandas from R . I used the reticulate library for the same. The sample code I used is given below

library(reticulate) use_condaenv("my_env_37",required=T) py_discover_config() py_run_string("import pandas as pd")

Error

JavaScript

Output from py_discover_config()

JavaScript

Conda version : 4.6.8 Python Version : 3.6.8 Pandas Version : 0.24.2 OS: RHEL 7.4 R Version : 3.5.1 reticulate Version : 1.9

Is there any other configuration we have to use for getting this working. When I run the same pandas import from Python alone it is working as expected.

Advertisement

Answer

It seems that your GCC is too old to be used with your R module. This issue is not related to R but the error message is the same.

Do you have several installations of GCC (in particular in /usr/local)? If so, you can try something like export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64 as suggested in the previous link I gave.

Otherwise, you should install a newer version of GCC (in a module environment if you still need your current version of GCC, see here for details, the explanations are very clear IMHO). Then, you will need to run R with your new environment.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement