Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: unable to load R code in package 'graphics' when compiling R 3.6.0 on Linux

I'm encountering a bug when building R on the amazonlinux:2018.03.0.20190212 docker image in bitbucket pipelines. The strange thing is if I run an EC2 (Amazon Linux 2018) I can run the exact same commands with no error.

Does anyone know how to solve this?

make[6]: Entering directory `/opt/R/src/library/graphics/src'
mkdir -p -- ../../../../library/graphics/libs
make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
Error : .onLoad failed in loadNamespace() for 'utils', details:
  call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
  error: error in running command
Error: unable to load R code in package 'graphics'
Execution halted

Manually, on EC2:

make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Entering directory `/opt/R/src/library/stats'
building package 'stats'

I'm not too familiar with R and don't find the error messages particularly informative.

like image 804
8t12c7081 Avatar asked Jun 04 '19 19:06

8t12c7081


1 Answers

I had the same issue, though not with Docker but with Singularity. For me it turned out that I was missing the 'which' binary from the container. After installing the 'which' package (I'm on CentOS7) and I was able to progress passed that error.

like image 88
TuxTobin Avatar answered Sep 30 '22 05:09

TuxTobin