# Installing cmdstan for cmdstanr

**URL:** <https://discourse.mc-stan.org/t/installing-cmdstan-for-cmdstanr/35249>\
**Category:** Interfaces\
**Tags:** rstan\
**Created:** [May 24, 2024, 10:50am UTC](https://discourse.mc-stan.org/t/installing-cmdstan-for-cmdstanr/35249 "2024-05-24T10:50:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![whlm6666](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/whlm6666/32/18532_2.png) [@whlm6666](https://discourse.mc-stan.org/u/whlm6666)\
**Post date:** [May 24, 2024, 10:50am UTC](https://discourse.mc-stan.org/t/installing-cmdstan-for-cmdstanr/35249/1 "2024-05-24T10:50:48Z")

</div>

Short summary of the problem  
l want to run examples from rethinking package, but ulam funtion is problem when complie model. l have downloaded Rtool42 and cmdstan. but cmdstan is not by running install\_cmdstan(). because the speed is unsuccessful  
install\_cmdstan()  
The C++ toolchain required for CmdStan is setup properly!  
试开URL’[https://api.github.com/repos/stan-dev/cmdstan/releases/latest](https://api.github.com/repos/stan-dev/cmdstan/releases/latest)’  
downloaded 14 KB

- Latest CmdStan release is v2.34.1
- Installing CmdStan v2.34.1 in C:\Users\lhj\Documents/.cmdstan/cmdstan-2.34.1
- Downloading cmdstan-2.34.1.tar.gz from GitHub…  
试开URL’[https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz)’  
试开URL’[https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz)’  
试开URL’[https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz)’  
试开URL’[https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz](https://github.com/stan-dev/cmdstan/releases/download/v2.34.1/cmdstan-2.34.1.tar.gz)’  
so l open the url mannualy to downloaded it.  
but have other problems.

```no-highlight
code_to_run_your_model(if_applicable)
library(rethinking)
set_cmdstan_path("C:/Users/lhj/Downloads/cmdstan-2.34.1 (1)/cmdstan-2.34.1")
data(rugged)
d <- rugged
d$log_gdp <- log(d$rgdppc_2000)
dd <- d[complete.cases(d$rgdppc_2000) ,]
dd$log_gdp_std <- dd$log_gdp / mean(dd$log_gdp)
dd$rugged_std <- dd$rugged / max(dd$rugged)
dd$cid <- ifelse( dd$cont_africa==1 , 1 , 2 )
dat_slim <- list(
  log_gdp_std = dd$log_gdp_std,
  rugged_std = dd$rugged_std,
  cid = as.integer( dd$cid )
)
m9.1 <- ulam(
  alist(
    log_gdp_std ~ dnorm( mu , sigma ) ,
    mu <- a[cid] + b[cid]*( rugged_std- 0.215 ) ,
    a[cid] ~ dnorm( 1 , 0.1 ) ,
    b[cid] ~ dnorm( 0 , 0.3 ) ,
    sigma ~ dexp( 1 )
  ) , data=dat_slim , chains=1 )

```

Compiling Stan program…  
Error in `process_initialize(self, private, command, args, stdin, stdout, …`:  
! Native call to `processx_exec` failed  
Caused by error in `chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …`:  
! Command ‘bin/stanc.exe’ not found @win/processx.c:982 (processx\_exec)  
l do not know how to solve  
If possible, add also code to simulate data or attach a (subset of) the dataset you work with.

Operating System:Windows 11 家庭中文版  
Interface Version:R version 4.2.2  
Compiler/Toolkit:

thank you so much on advance!

---

<div class="post-metadata">

**Author:** ![aakhmetz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/aakhmetz/32/18672_2.png) [@aakhmetz](https://discourse.mc-stan.org/u/aakhmetz)\
**Post date:** [May 28, 2024, 3:02am UTC](https://discourse.mc-stan.org/t/installing-cmdstan-for-cmdstanr/35249/2 "2024-05-28T03:02:17Z")

</div>

You can try to run cmdstan in GoogleColab and see if there is any error
