clusterProfiler / Installation errors

Causes and fixes for clusterProfiler installation errors

Common errors when installing and loading clusterProfiler and its dependencies, listed by exact message, each with its cause and fix.

Short answer

clusterProfiler depends on a chain of packages such as DOSE, enrichplot, GOSemSim, ggtree and yulab.utils, and they must all come from the same Bioconductor release; if one is too old or too new, the install fails partway.

Setting up your environment this way avoids most errors on this page.

PracticeWhat happens if you skip it
Install every Bioconductor package with BiocManager::install() instead of mixing in install.packages() or GitHub versions.Packages from different Bioconductor releases mix and you get errors like GOSemSim too old or ls2df not exported.
Use a recent R. Each Bioconductor release targets one R minor version, so an old R only gets an old Bioconductor.On an old R, ggtree and other dependencies may fail to install, or you get old versions with known bugs.
After upgrading R, run BiocManager::valid() and update all outdated or too-new packages in one go.Old packages stay in the new R and lazy loading failed errors keep appearing.
Keep a separate package library per R version and do not share it across systems or versions.Windows ends up reading packages built for Linux and reports Package was created for x86_64-pc-linux-gnu.
When an install fails, start with the first package that failed at the top of the log.Reinstalling clusterProfiler itself just repeats dependency is not available.

Troubleshooting by error message

Find your exact error message. Each entry gives the cause, the fix, and what may come up after the fix.

object 'ls2df' is not exported by 'namespace:yulab.utils' (followed by lazy loading failed for package 'GOSemSim')

Cause: The newer GOSemSim uses ls2df, a newer yulab.utils function, but the installed yulab.utils is too old.

Fix: Update it with BiocManager::install("yulab.utils"), then reinstall GOSemSim and clusterProfiler.

What may come next: After updating yulab.utils, ggtree, enrichplot and other packages by the same authors may need updating too.

namespace 'GOSemSim' 2.24.0 is being loaded, but >= 2.27.2 is required

Cause: The installed GOSemSim comes from an older Bioconductor release than clusterProfiler requires.

Fix: Run BiocManager::valid() to see which packages are out of step, then update them with the command it prints.

What may come next: Upgrading GOSemSim alone usually leads straight to the ls2df error above.

Error: unable to load R code in package ‘ggtree’ / ERROR: lazy loading failed for package ‘ggtree’

Cause: R is too old and the matching ggtree has a known bug (for example ggtree 3.2.1 on R 4.1.2), so it cannot load after installing.

Fix: Upgrade R, then install clusterProfiler with BiocManager::install().

What may come next: After a minor R upgrade, every R package must be reinstalled for the new version.

ERROR: dependency ‘enrichplot’ is not available for package ‘clusterProfiler’

Cause: This is a follow-on error: enrichplot, or ggtree, igraph or another package it needs, failed earlier.

Fix: Scroll up the install log to the first package with ERROR and handle it with the matching entry on this page.

installation of package 'igraph' had non-zero exit status (then tidygraph, ggraph and enrichplot fail too)

Cause: igraph must be compiled from source and the build fails in this environment, so every package that needs it fails as well.

Fix: Download the igraph 1.6.0 and tidygraph 1.3.0 source packages from the CRAN archive and install them with install.packages(..., repos = NULL, type = "source").

What may come next: Pinning old versions gets you running, but later updates to other packages may demand a newer igraph again.

Error in buildLookupTable(letter_byte_vals, codes) : 'vals' must be a vector of the length of 'keys' (then Biostrings, R.oo and yulab.utils report lazy loading failed)

Cause: The recommended packages that ship with R (boot, Matrix, nlme and others) sit in a system folder without write access and were never updated.

Fix: Update those recommended packages with administrator rights, then reinstall clusterProfiler.

What may come next: If a machine has several package libraries, also check which one R actually loads.

there is no package called ‘tibble’ (shown before ERROR: lazy loading failed for package ‘DO.db’)

Cause: AnnotationDbi, which DO.db needs, requires tibble, and tibble is not installed.

Fix: Install the missing package named in the error, for example install.packages("tibble"), then reinstall clusterProfiler.

What may come next: Other packages may be missing in the same install, and each one means another rerun.

Error: package or namespace load failed for clusterProfiler: object HPOGENE is not exported by namespace HPO.db

Cause: The installed HPO.db does not match the newer clusterProfiler.

Fix: Remove the old one with remove.packages("HPO.db"), install it again with BiocManager::install("HPO.db"), then reinstall clusterProfiler.

What may come next: Installing HPO.db may then hit a BiocFileCache cache error, which needs BiocFileCache updated first.

Package 'S4Vectors' was created for x86_64-pc-linux-gnu (when installing on Windows)

Cause: The R package library points to a folder of packages built for Linux, so R on Windows reads incompatible packages.

Fix: Check the library with .libPaths(), switch to a new empty folder, and reinstall the Bioconductor packages and clusterProfiler.

What may come next: After switching libraries, every package you had must be reinstalled.

Scientify is a cloud computer with research software installed and AI agents such as Codex and Claude Code built in. Describe what you need in one sentence, for example "run GO and KEGG enrichment on this list of differentially expressed genes and draw a dot plot", and the agent uses the preinstalled clusterProfiler to do the modeling and computation, with no software to install and no code to write.

Compared with installing more on your own computer, the cloud computer already has R 4.4.3 and clusterProfiler 4.14.0, with DOSE, enrichplot, GOSemSim and the other dependencies from one Bioconductor release, plus DESeq2, so version mismatch errors do not come up, and runs continue after you close your laptop.

The cloud computer comes with more computing power: CPU and GPU clusters can be called on demand for large-scale scientific computing. Compute is billed by the minutes you actually use, so nothing is wasted.

Cloud computer
4 vCPU · 8 GB
Top configuration, for data processing and small to medium jobs
Callable GPU
96 GB VRAM
Up to an RTX PRO 6000 per GPU; H800 80 GB and up to 8 × A10G also available
Callable CPU
224 cores · 3 TB
Largest spec, for large parallel computations

References

Frequently asked questions

Can clusterProfiler be installed with install.packages()?

No. It is a Bioconductor package: install BiocManager first, then run BiocManager::install("clusterProfiler").

How do I check that installed package versions match?

Run BiocManager::valid(). It lists outdated or too-new packages and prints one command that brings them in line with your Bioconductor release.

Do I need to reinstall packages after upgrading R?

After a minor upgrade (for example 4.3 to 4.4), yes; the new R uses a new package library.

Run enrichment analysis with Scientify without setup

Upload your data, describe the computation, and Scientify runs it on a cloud computer that is already set up. New accounts get a free cloud computer and US$5 in credit.