GitHub Actions Matrix version error

I use GitHub Actions (R-CMD-check) to check my packages. I've been getting a strange error with R 4.0 (but not 4.1):

 ** R
 ** inst
 ** byte-compile and prepare package for lazy loading
 Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
   namespace ‘Matrix’ 1.3-2 is already loaded, but >= 1.3.3 is required
 Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
 Execution halted

It's especially odd because earlier in the logs it states that Matrix 1.4-1 was installed. I do not see any mentions of Matrix 1.3-2 or 1.3.3.

What does this error mean?

You'll need to show us the workflow file and the run that fails.

Unfortunately I cannot reproduce this locally. I also don't quite understand why R would load the older Matrix version from the system library.

You could try removing Matrix from the system library, put a step before setup-r-dependencies that looks like this:

- name: Remove pre-installed Matrix
  run: remove.packages("Matrix", lib = .Library)
  shell: Rscript {0}

Yes, this is the part I was trying to understand.

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.