undefined symbol: libiconv

Hi.
I installed tidyverse in conda environment,but it could not be library.Then I tried to install pheatmap package in conda environment and successfully loaded it into RStudio.I don't know what happened and how to deal with it. I want to run R in conda environment in RStudio. Here is my running record.

Sys.setenv(LANGUAGE = 'en')
.libPaths('/home/gjdhxy/miniconda3/envs/R/lib/R/library/')
.libPaths()
library(pheatmap)
library(tidyverse)
>Sys.setenv(LANGUAGE = 'en')
>.libPaths('/home/gjdhxy/miniconda3/envs/R/lib/R/library/')
>.libPaths()
[1] "/home/gjdhxy/miniconda3/envs/R/lib/R/library"
[2] "/usr/lib64/R/library" 
>library(pheatmap)
>library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/gjdhxy/miniconda3/envs/R/lib/R/library/haven/libs/haven.so':
  /home/gjdhxy/miniconda3/envs/R/lib/R/library/haven/libs/haven.so: undefined symbol: libiconv

You can find information on the source of this here. Fixing it may be as simple as installing the iconv system library. Or you may already have it but it cannot be found properly due to the conda environment.

I really like conda. But only for Python. I can't recall hearing anyone here saying how pleased they are with using conda for R. It's a highly personal choice, but you should think about the benefits it provides compared to dealing with the problems it's been known to cause.

Thank you very much for your warm help.
I tried the repair methods you provided, but didn't work. I uninstalled tidyverse installed in conda environment, and then use install.packges('tidyverse') to install it in R. According to the error, I installed zlib-devel, libxml2-devel, libcurl-devel, openssl-devel, and then reinstalled tidyverse in conda when all the errors were package ‘XX’ is not available for this version of R. At this time, RStudio can work normally.

These are not R packages but system libraries. How to install them depends on your operating system—a Linux variant, macOS or Windows. Which are you?

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.