‘StanHeaders’ version 2.18.1 cannot be unloaded

I could not find information for the following problem:

I’m using macOS Catalina, version 10.15.3

I’ve just upgraded R to version 3.6.3

I re-installed RStan, but then I got the following error message

Loading required package: StanHeaders
Error in value[3L] :
Package ‘StanHeaders’ version 2.18.1 cannot be unloaded:
Error in unloadNamespace(package) : namespace ‘StanHeaders’ is imported by ‘rstan’ so cannot be unloaded

I tried to install StanHeaders only, but it seems that the only version available is 2.21

— Please select a CRAN mirror for use in this session —
trying URL ‘https://cran.wu.ac.at/bin/macosx/el-capitan/contrib/3.6/StanHeaders_2.21.0-1.tgz

So at the moment I cannot use Rstan.
This is somehow urgent, and would appreciate your help

Thank you,


You should be able to do (in a clean R session)

repos = NULL, type = "source")