ComplexHeatmap install error
Entering edit mode
nalaspina • 0
Last seen 12 days ago
United States

I've downloaded the ComplexHeatmap function many of times before, but this is the first time I've seen this error message. It comes up after I try the following code, then try running the library command. R version is 4.0.0.

if (!require("BiocManager", quietly = TRUE))

BiocManager::install("ComplexHeatmap", force = TRUE)


> library(ComplexHeatmap)

enter image description here

Error: package or namespace load failed for ‘ComplexHeatmap’:
 .onLoad failed in loadNamespace() for 'Cairo', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Users/nathan.laspina/Documents/R/win-library/4.0/Cairo/libs/x64/Cairo.dll':
  LoadLibrary failure:  The specified procedure could not be found.
In addition: Warning message:
package ‘ComplexHeatmap’ was built under R version 4.0.3 

It seems like it just got saved to the wrong place, how can I change that location?

>BiocManager::install("ComplexHeatmap", force = TRUE)

'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:

Bioconductor version 3.12 (BiocManager 1.30.18), R 4.0.0 (2020-04-24)
Installing package(s) 'ComplexHeatmap'
trying URL ''
Content type 'application/zip' length 3286900 bytes (3.1 MB)
downloaded 3.1 MB

package ‘ComplexHeatmap’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
Installation paths not writeable, unable to update packages
  path: C:/Program Files/R/R-4.0.0/library
    boot, class, cluster, codetools, foreign, KernSmooth, lattice, MASS, Matrix, mgcv, nlme,
    nnet, rpart, spatial, survival
Old packages: 'cli', 'dbplyr', 'dplyr', 'tibble'
Update all/some/none? [a/s/n]: 
ComplexHeatmap • 104 views
Entering edit mode
Last seen 40 minutes ago
United States

You should upgrade to R-4.2.0 and Bioc 3.15. We don't support old versions, because it's hard enough to support the release versions.

The error you are getting has nothing to do with ComplexHeatmap though - if you look closely it's complaining about not being able to load your Cairo.dll, which is part of the Cairo package, not ComplexHeatmap.

Also, unless there is something wrong with a given package, there is almost never a reason to use force = TRUE. That argument forces BiocManager::install to re-install an existing package, and if you have an existing package and it works, there is no reason to download and install it again. If that's something you do regularly, you shouldn't.

Entering edit mode

Thank you. A quick question about upgrading to a newer version of R, if I may. I thought one should always stay 1 version behind because newer versions tend to have more issues with bug/crashes. Is that not true?

Entering edit mode

That's not my experience. I always upgrade to the new version of R/BioC on the day it's released, and I've never thought it was a bad idea because of bugs. And I use R all day every day, so I imagine if there were consistent problems I would have noticed them by now.

That said, there may be issues that arise where the maintainer of a package realizes there is a bug (or somebody tells them about it), and they push a fix. But for most packages the bugs are real edge cases that won't arise for most people. Something like ComplexHeatmap gets used by thousands of people every day, and if there were a problem you know for sure people would complain and it would get fixed quickly.

But anyway, IMO you should upgrade at release, every time.


Login before adding your answer.

Traffic: 515 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6