The issue you are facing was multi-fold due to which it took some time on our side as well to figure best solution for you.
- The procedure you were following was correct except
apt.txtfile. This file excepts just the packages name you want to install (although it isn’t the fix/cause of the error). So it should be something like:
~❯ cat apt.txt
libicu-dev
But the error still continues as:
> library('tidyverse')
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/srv/conda/envs/notebook/lib/R/library/stringi/libs/stringi.so':
libicui18n.so.64: cannot open shared object file: No such file or directory
We found the issue is due to the dependency r-tidyverse -> r-stringr -> r-stringi, and r-stringi package in conda-forge channel is broken.
- We checked with the recommended channel i.e. r and it had working packages by default, so this should have worked at first place.
- r::r-tidyverse
- r::r-stringi
- [Solution; tldr] But I remember from our call, you needed 1.3.0 version specifically. So, this is the environment.yml entry you need for 1.3.0. Basically getting r-stringr from r channel instead of conda-forge one.
- conda-forge::r-tidyverse==1.3.0
- r::r-stringr
- r::r-stringi
Sorry that you went through long debug cycle.
[Update] I found issue on Github in conda-forge repository as well, and have added the comment about this issue there. https://github.com/conda-forge/r-stringi-feedstock/issues/20