sagemathinc / cocalc-compute-docker

Docker image for adding remote compute capabilities to a CoCalc project.
Other
2 stars 1 forks source link

installing the R package tufte via R Studio is broken #9

Closed williamstein closed 6 months ago

williamstein commented 6 months ago
Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/tufte_0.13.tar.gz'
Content type 'application/x-gzip' length 251676 bytes (245 KB)
==================================================
downloaded 245 KB

* installing *source* package ‘tufte’ ...
** package ‘tufte’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/site-library/rlang/libs/rlang.so':
  /usr/local/lib/R/site-library/rlang/libs/rlang.so: undefined symbol: EXTPTR_PROT
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘tufte’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.1/tufte’
Warning in install.packages :
  installation of package ‘tufte’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpFRuyMG/downloaded_packages’
williamstein commented 6 months ago

Some notes:

Unfortunately, I'm 100% completely stumped about this, and am going to close this with cantfix. This isn't a general problem with all packages -- in fact every other one I tried worked.

I am updating right now the version of R that we provide, and also fixing the permissions so you can install packages systemwide fine as the normal user (instead of being root).

williamstein commented 6 months ago

I just realized that Rstudio is weirdly installing (?) and running an ancient version of R:

image

I figured out how to fix this and it actually works to fix this problem!

image
williamstein commented 6 months ago

Fixed:

image

However a new problem appears, due to maybe the systemwide R 4.3.3 we have being built without enough support, or some other option being needed:

> plot(c(1,2,3))
Error in RStudioGD() : 
  Shadow graphics device error: r error 4 (Error in .External2(C_X11, paste0("png::", filename), g$width, g$height,  : 
  unable to start device PNG
)
In addition: Warning message:
In grDevices:::png("/tmp/RtmpW2TUo9/6f3bdcaa91e34f58a4b85eba61fd1f63.png",  :
  unable to open connection to X11 display ''
williamstein commented 6 months ago

Fixed