Question: DESeq2 installing error: S4Vectors cannot be unloaded; anyone?
gravatar for nidz91
2.0 years ago by
nidz910 wrote:

I am having trouble installing DESeq2:


Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.2 (2016-10-31).
Installing package(s) ‘DESeq2’
also installing the dependency ‘S4Vectors’

trying URL ''
Content type 'application/x-gzip' length 1130228 bytes (1.1 MB)
downloaded 1.1 MB

trying URL ''
Content type 'application/x-gzip' length 1781581 bytes (1.7 MB)
downloaded 1.7 MB

The downloaded binary packages are in
> library("DESeq2", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
Loading required package: S4Vectors
Error in unloadNamespace(package) : 
  namespace ‘S4Vectors’ is imported by ‘IRanges’, ‘Biostrings’, ‘XVector’ so cannot be unloaded
In addition: Warning message:
package ‘S4Vectors’ was built under R version 3.3.3 
Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc,  : 
  Package ‘S4Vectors’ version 0.12.1 cannot be unloaded



> remove.packages('S4Vectors')
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library’
(as ‘lib’ is unspecified)

Error: package ‘S4Vectors’ required by ‘DESeq2’ could not be found
In addition: Warning message:
In read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
  cannot open compressed file '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/S4Vectors/DESCRIPTION', probable reason 'No such file or directory'


My R version:

platform       x86_64-apple-darwin13.4.0   
arch           x86_64                      
os             darwin13.4.0                
system         x86_64, darwin13.4.0        
major          3                           
minor          3.2                         
year           2016                        
month          10                          
day            31                          
svn rev        71607                       
language       R                           
version.string R version 3.3.2 (2016-10-31)
nickname       Sincere Pumpkin Patch 


Is there no other way but to update R to 3.3.3 to use DESeq2? 

ANY DESeq2 users suggestions appreciated!


deseq2 installation • 2.6k views
ADD COMMENTlink modified 2.0 years ago by Martin Morgan ♦♦ 23k • written 2.0 years ago by nidz910

Ok, Martin Morgan was right, I had to start a new session. R --vanilla did not work for some reason so I started new project. I loaded DESeq2 first and then phyloseq. So far so good!

ADD REPLYlink written 2.0 years ago by nidz910

Why don't you want to update to a newer R (e.g. 3.4.1 is current)?

ADD REPLYlink written 2.0 years ago by Wolfgang Huber13k
Answer: DESeq2 installing error: S4Vectors cannot be unloaded; anyone?
gravatar for Martin Morgan
2.0 years ago by
Martin Morgan ♦♦ 23k
United States
Martin Morgan ♦♦ 23k wrote:

Make sure you do not have any R sessions running.

Start R from the command line, using R --vanilla

Run BiocInstaller::biocValid() and follow directions to update / downgrade individual packages.

Use BiocInstaller:biocLite("S4Vectors") to re-install S4Vectors.

Use library(DESeq2) (no library path) to load DESeq2.

If for some reason you want to install and use packages from a particular library location, do so consistently and in a way that avoids duplicate package installations across active library paths. For instance, set .libPaths() to contain a 'session-specific' library path (e.g., Bioc version 3.4 packages) and a 'system' library path (base and recommended packages only)

ADD COMMENTlink written 2.0 years ago by Martin Morgan ♦♦ 23k

This exactly works!

ADD REPLYlink written 21 months ago by elximo0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 285 users visited in the last hour