Installing DESeq2 fails ; R can't find basic commands like 'rm' and 'mv'
1
0
Entering edit mode
mja18 ▴ 40
@mja18-23865
Last seen 3.6 years ago
United States

So this might not be a Bioconductor question per se, but the error revealed itself when trying to install a Bioconductor package.

When trying to install DESeq2, I am failing because the dependency 'SummarizedExperiment' will not install. The console error messages seem to indicate shell errors where basic commands such as 'rm' and 'mv' are not being found.

When I check R's PATH using Sys.getenv() , the PATH looks normal and has the place where these commands are.

I have a sneaking suspicion that Apple did this to me. I updated my OS from Mojave to Catalina, and ever since whenever I open a Terminal window I have a message saying:

The default interactive shell is now zsh. To update your account to use zsh, please runchsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050.

Behind the scenes when R is trying to do my install, is it falling into a shell that doesn't even know where rm and mv are? If so, any ideas on how to fix this?

R version 4.0.0, Bioconductor version 3.11. Full console information below with sessionInfo() at bottom.

> BiocManager::install("DESeq2")
Bioconductor version 3.11 (BiocManager 1.30.10), R 4.0.0 (2020-04-24)
Installing package(s) 'DESeq2'
also installing the dependency ‘SummarizedExperiment’


  There is a binary version available but the source version is later:
                     binary source needs_compilation
SummarizedExperiment 1.18.1 1.18.2             FALSE

trying URL 'https://bioconductor.org/packages/3.11/bioc/bin/macosx/contrib/4.0/DESeq2_1.28.1.tgz'
Content type 'application/x-gzip' length 1887714 bytes (1.8 MB)
==================================================
downloaded 1.8 MB


The downloaded binary packages are in
    /var/folders/82/x9hk21dx19jfp44kk7njvcqc0000gn/T//RtmpQAF98w/downloaded_packages
installing the source package ‘SummarizedExperiment’

trying URL 'https://bioconductor.org/packages/3.11/bioc/src/contrib/SummarizedExperiment_1.18.2.tar.gz'
Content type 'application/x-gzip' length 1520747 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘SummarizedExperiment’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
sh: rm: command not found
** help
*** installing help indices
** building package indices
sh: rm: command not found
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: rm: command not found
sh: mv: command not found
Warning in system(paste("mv -f", shQuote(instdir), shQuote(dirname(final_instdir)))) :
  error in running command
ERROR:   moving to final location failed
sh: rm: command not found

The downloaded source packages are in
    ‘/private/var/folders/82/x9hk21dx19jfp44kk7njvcqc0000gn/T/RtmpQAF98w/downloaded_packages’
Warning message:
In install.packages(...) :
  installation of package ‘SummarizedExperiment’ had non-zero exit status

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] BiocManager_1.30.10 compiler_4.0.0      tools_4.0.0        

deseq2 install software error • 1.7k views
ADD COMMENT
0
Entering edit mode

I don't have a mac, but this forum post says you might need xcode?

https://community.rstudio.com/t/cannot-install-package-error-sh-rm-command-not-found/34133

Try googling around with your specific errors like:

sh: rm: command not found
ADD REPLY
0
Entering edit mode

Thanks. I had full Xcode installed. I also installed xcode-select , per the post you linked to, then rebooted. Alas, did not fix it.

The googling mostly leads to people who have done something silly like

sudo /bin/rm /bin/rm

or messed up their path with a strange .bash_profile, which wasn't me! Normal shell commands still work on my device. It's just the install process from R that has issues.

ADD REPLY
0
Entering edit mode

It does indeed seem strange. I'd try to reproduce this in a simpler context, e.g.,

system("ls")
instdir <- tempfile(); dir.create(instdir)
final_instdir <- tempfile()
system(paste("mv -f", shQuote(instdir), shQuote(final_instdir)))

XCode should not been needed for binary package installation.

ADD REPLY
0
Entering edit mode

Thanks,

The tests you suggested all work fine in my R console. But the installation attempt still gives same errors for 'SummarizedExperiment' attempted installation.

ADD REPLY
4
Entering edit mode
mja18 ▴ 40
@mja18-23865
Last seen 3.6 years ago
United States

face <- palm

Turns out I had a bad line in my ~/.Renviron file that nuked the PATH. Fixing that solved my issue.

It was a bit confusing because, when Sys.getenv() was run from within an RStudio session, the reported PATH was fine. It was only when R was invoked from my terminal that I could see the PATH was not set correctly. It must be that during package installation the ~/.Renviron file was invoked.

Anyway, thanks for the suggestions.

ADD COMMENT

Login before adding your answer.

Traffic: 1051 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6