MaastrichtU-IDS / dsri-workshop-start-app

⚡ Short workshop to start Data Science applications on the Data Science Research Infrastructure at Maastricht University
https://maastrichtu-ids.github.io/dsri-workshop-start-app
Creative Commons Zero v1.0 Universal
4 stars 1 forks source link

some packages cannot be installed in Rtudio Server? #6

Open NimoLululu opened 5 months ago

NimoLululu commented 5 months ago

Hi there, I am trying to use DSRI to run my project. some packages could be installed successfully on my local PC. however, it doesn't work via Rsuodio server...

Here is the error message:

install.packages('terra') Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) trying URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/terra_1.7-71.tar.gz' Content type 'binary/octet-stream' length 4036262 bytes (3.8 MB)

downloaded 3.8 MB

The downloaded source packages are in ‘/tmp/RtmpN52xWI/downloaded_packages’

library(terra) Error: package or namespace load failed for ‘terra’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/site-library/terra/libs/terra.so': libproj.so.15: cannot open shared object file: No such file or directory

have you ever encountered this before? how did you fix it ?

Thanks !

vemonet commented 5 months ago

Mmmh, I have never used RStudio so I don't know much

Normally you are using the Rstudio image defined here: https://github.com/MaastrichtU-IDS/RStudio

It is based on the most popular docker image for deploying RStudio (Rocker). It should handle installing packages out of the box (that's kind of the minimum to do when you configure such image)

I'd recommend to paste your problem in a LLM, they are quite good giving guidance to fix such basic sysadmin bugs

And bring the changes to the Dockerfile so it's fixed for everyone using the image

@seunAdeks

seunAdeks commented 5 months ago

I just deployed the terra package on Rstudio (DSRI) and it works just fine. See the screenshot.

Capture1

You need to switch to the terminal tab and install the dependencies first

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get update sudo apt-get upgrade sudo apt-get install libgdal-dev libgeos-dev libproj-dev

Then back to the console terminal to install the library with R-dependencies:

install.packages(c("raster", "Rcpp")) install.packages('terra')

@vemonet

vemonet commented 5 months ago

Would this make sense to add these dependencies to the dockerfile of the dsri RStudio image ?

seunAdeks commented 5 months ago

I don't think so, this is too specific and would just be a bloatware mostly.