Hello,
I am having a heck of a time getting the rethinking package to install. Install hangs up on the lazy loading stage and then throws an error. Tried installing via devtools from github as instructed without success. Tried via remotes from github as alternative, same problem. Tried using pak::pak(βuser/repoβ) instead of devtools without luck. Downloaded rethinking-master.zip and tried to install from local, but still also hangs up on the lazy loading step. I made sure all dependencies were downloaded and ran again with same issue with lazy loading stage failing.
Any advice for next steps?
R version 4.5.3 installed. Rtools 45 installed and path setup. Installed cmdstanr successfully and toolchain is working properly.
> R.version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 5.3
year 2026
month 03
day 11
svn rev 89597
language R
version.string R version 4.5.3 (2026-03-11 ucrt)
nickname Reassured Reassurer
> cmdstanr::check_cmdstan_toolchain()
The C++ toolchain required for CmdStan is setup properly!
Output from attempted github install instructions:
>install.packages(c("coda","mvtnorm","devtools","loo","dagitty","shape"))
>devtools::install_github("rmcelreath/rethinking")
Downloading GitHub repo rmcelreath/rethinking@HEAD
Skipping 1 packages not available: cmdstanr
ββ R CMD build ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β checking for file 'C:\Users\bdemuth\AppData\Local\Temp\RtmpWM65gA\remotes722464fe6f97\rmcelreath-rethinking-ac1b3b2/DESCRIPTION'
β preparing 'rethinking': (555ms)
β checking DESCRIPTION meta-information ...
β checking for LF line-endings in source and make files and shell scripts
β checking for empty or unneeded directories
β looking to see if a 'data/datalist' file should be added
β building 'rethinking_2.42.tar.gz' (893ms)
Installing package into βC:/Users/bdemuth/AppData/Local/R/win-library/4.5β
(as βlibβ is unspecified)
* installing *source* package 'rethinking' ...
** this is package 'rethinking' version '2.42'
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
ERROR: lazy loading failed for package 'rethinking'
* removing 'C:/Users/bdemuth/AppData/Local/R/win-library/4.5/rethinking'
* restoring previous 'C:/Users/bdemuth/AppData/Local/R/win-library/4.5/rethinking'
Warning messages:
1: `install_github()` was deprecated in devtools 2.5.0.
βΉ Please use pak::pak("user/repo") instead.
This warning is displayed once per session.
Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.
2: In i.p(...) :
installation of package βC:/Users/bdemuth/AppData/Local/Temp/RtmpWM65gA/file72247ff37b19/rethinking_2.42.tar.gzβ had non-zero exit status
Given that, I attempted to install via remotes:
install.packages("remotes")
Installing package into βC:/Users/bdemuth/AppData/Local/R/win-library/4.5β
(as βlibβ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/remotes_2.5.0.zip'
Content type 'application/zip' length 436537 bytes (426 KB)
downloaded 426 KB
package βremotesβ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\bdemuth\AppData\Local\Temp\RtmpWM65gA\downloaded_packages
> remotes::install_github("rmcelreath/rethinking")
Downloading GitHub repo rmcelreath/rethinking@HEAD
Skipping 1 packages not available: cmdstanr
ββ R CMD build ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β checking for file 'C:\Users\bdemuth\AppData\Local\Temp\RtmpWM65gA\remotes722466cd2076\rmcelreath-rethinking-ac1b3b2/DESCRIPTION'
β preparing 'rethinking': (561ms)
β checking DESCRIPTION meta-information ...
β checking for LF line-endings in source and make files and shell scripts
β checking for empty or unneeded directories
β looking to see if a 'data/datalist' file should be added
β building 'rethinking_2.42.tar.gz' (919ms)
Installing package into βC:/Users/bdemuth/AppData/Local/R/win-library/4.5β
(as βlibβ is unspecified)
* installing *source* package 'rethinking' ...
** this is package 'rethinking' version '2.42'
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
ERROR: lazy loading failed for package 'rethinking'
* removing 'C:/Users/bdemuth/AppData/Local/R/win-library/4.5/rethinking'
* restoring previous 'C:/Users/bdemuth/AppData/Local/R/win-library/4.5/rethinking'
Warning message:
In i.p(...) :
installation of package βC:/Users/bdemuth/AppData/Local/Temp/RtmpWM65gA/file72242c1315a3/rethinking_2.42.tar.gzβ had non-zero exit status
I tried uninstalling R and Rstudio both and did fresh installs. I also even attempted R 4.4.3 with rtools 44 as well with no luck even getting through the cmdstanr install steps. So, I am now back to a freshly installed R version 4.5.3 installed with Rtools 45 installed and path setup. Installed cmdstanr successfully and toolchain is working properly. no other version of R, rstudio or Rtools are on my device to conflict. Tried deleting %temp% (rtmp files). No 00Lock temp files.