tidyverse loading difference between JupyterLab and RStudio
See original GitHub issueBug description
The R package tidyverse
loads successfully in JupyterLab but fails in RStudio.
We use as an example this repository that contains the description of a R environment with the tidyverse
package installed with conda.
Expected behaviour
The R instruction
library(tidyverse)
should work without any error.
Actual behaviour
In JupyterLab, we can load tidyverse
both in a R notebook:
and in a terminal:
In RStudio, this fails:
For debugging purpose, here is the output of the sessionInfo()
instruction:
R version 4.1.3 (2022-03-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS
Matrix products: default
BLAS/LAPACK: /srv/conda/envs/notebook/lib/libopenblasp-r0.3.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] fansi_1.0.3 utf8_1.2.2 digest_0.6.29 crayon_1.5.1
[5] IRdisplay_1.1 repr_1.1.4 lifecycle_1.0.1 jsonlite_1.8.0
[9] evaluate_0.15 pillar_1.7.0 rlang_1.0.2 cli_3.2.0
[13] uuid_1.1-0 vctrs_0.4.1 ellipsis_0.3.2 IRkernel_1.2
[17] tools_4.1.3 glue_1.6.2 fastmap_1.1.0 compiler_4.1.3
[21] base64enc_0.1-3 pbdZMQ_0.3-7 htmltools_0.5.2
How to reproduce
Create an environment with repo2docker
and this repository.
Try to run the R command:
library(tidyverse)
You are sure tidyverse
is loaded correctly when you can run this second command also without error:
as_tibble(mtcars)
Your personal set up
- OS: Linux Ubuntu 20.04
- Docker version: 20.10.14, build a224086
- repo2docker version: 2022.02.0+19.g1d218af
A possible lead (or not)
I suspect an issue with the availability of C++ libraries.
In a terminal, in RStudio, I have:
$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.26
$ strings /srv/conda/envs/notebook/lib/libstdc++.so.6 | grep GLIBCXX.3.4.26
GLIBCXX_3.4.26
GLIBCXX_3.4.26
So, I guess R within RStudio should have access to /srv/conda/envs/notebook/lib/libstdc++.so.6
rather to /usr/lib/x86_64-linux-gnu/libstdc++.so.6
only.
What puzzles me is that in RStudio we have:
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/srv/conda/envs/notebook/lib/R/lib"
but in JupyterLab we have:
> Sys.getenv("LD_LIBRARY_PATH")
[1] ""
So this lead could be wrong…
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top GitHub Comments
Some relevant information in https://discourse.jupyter.org/t/openssl-mismatch-between-rstudio-and-conda-environments/14123/
I am having a related issue when running Shiny apps:
Starting a Shiny app from within RStudio…
…leads to the following error:
I tried installing
libstdc++6
andgcc-8
viaapt.txt
, but that didn’t help. The Shiny interface at/shiny/r/bus-dashboard/
does work, however, as does running the code above from JupyterLab.Here’s a repository for you to check:
gitlab.com/fkohrt/binder-test
environment.yml
Most important, this is only an issue when using
environment.yml
to install R:If I use
requirements.txt
instead, none of the issues are present – I can dolibrary(tidyverse)
andshiny::runApp("r/bus-dashboard")
without any problems, but now the Shiny interface at/shiny/r/bus-dashboard/
does not work (An error has occurred!
). This can be verified with the following repository:gitlab.com/fkohrt/RMarkdown-sandbox