# CmdStan.jl fails on documentation example - path issues

**URL:** <https://discourse.julialang.org/t/cmdstan-jl-fails-on-documentation-example-path-issues/26023>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [July 4, 2019, 8:10pm UTC](https://discourse.julialang.org/t/cmdstan-jl-fails-on-documentation-example-path-issues/26023 "2019-07-04T20:10:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanivab](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yanivab/32/9164_2.png) [@yanivab](https://discourse.julialang.org/u/yanivab)\
**Post date:** [July 4, 2019, 8:10pm UTC](https://discourse.julialang.org/t/cmdstan-jl-fails-on-documentation-example-path-issues/26023/1 "2019-07-04T20:10:35Z")

</div>

I’m trying to run the basic example in the CmdStan.jl [documentation](https://stanjulia.github.io/CmdStan.jl/stable/WALKTHROUGH/).

However, I’m getting path related errors.

When I try to specify the project folder in the call to stan:

> using CmdStan  
> set\_cmdstan\_home!(“/Users/yanivabir/cmdstan”)
> 
> bernoullistanmodel = "  
> data {  
> int\<lower=0\> N;  
> int\<lower=0,upper=1\> y[N];  
> }  
> parameters {  
> real\<lower=0,upper=1\> theta;  
> }  
> model {  
> theta ~ beta(1,1);  
> y ~ bernoulli(theta);  
> }  
> "
> 
> stanmodel = Stanmodel(name=“bernoulli”, model=bernoullistanmodel);
> 
> bernoullidata = Dict(“N” =\> 10, “y” =\> [0, 1, 0, 1, 0, 0, 0, 0, 0, 1])
> 
> rc, chns, cnames = stan(stanmodel, bernoullidata, “/Path/to/folder”)

I get the following error:

> An error occurred while compiling the Stan program.
> 
> Please check your Stan program in variable ‘bernoulli’ and the contents of /Path/to/folder/tmp/bernoulli\_build.log.  
> Note that Stan does not handle blanks in path names.

A tmp folder is made in my project folder, with the files bernoulli.stan, bernoulli\_build.log and bernoulli\_make.log in it.

When I don’t try to specify the project directory, the stan program compiles, samples are drawn and saved to csv (inside a tmp folder in my cmdstan folder), but then CmdStan.jl gives an error:

I run:

> using CmdStan  
> set\_cmdstan\_home!(“/Users/yanivabir/cmdstan”)
> 
> bernoullistanmodel = "  
> data {  
> int\<lower=0\> N;  
> int\<lower=0,upper=1\> y[N];  
> }  
> parameters {  
> real\<lower=0,upper=1\> theta;  
> }  
> model {  
> theta ~ beta(1,1);  
> y ~ bernoulli(theta);  
> }  
> "
> 
> stanmodel = Stanmodel(name=“bernoulli”, model=bernoullistanmodel);
> 
> bernoullidata = Dict(“N” =\> 10, “y” =\> [0, 1, 0, 1, 0, 0, 0, 0, 0, 1])
> 
> rc, chns, cnames = stan(stanmodel, bernoullidata)

and get:

> Base.IOError(“could not spawn `/Users/yanivabir/cmdstan/bin/stansummary --csv_file=bernoulli_summary.csv bernoulli_samples_1.csv bernoulli_samples_2.csv bernoulli_samples_3.csv bernoulli_samples_4.csv`: no such file or directory (ENOENT)”, -2)  
> Stan.jl caught above exception in Stan’s ‘stansummary’ program.  
> This is a usually caused by the setting:  
> Sample(save\_warmup=true, thin=n)  
> in the call to stanmodel() with n \> 1.

Looking at the folder, the four sample csv files are there, but there is not summary.csv file.  
It then prints chns as if everything is ok.

Any help much appreciated!

---

<div class="post-metadata">

**Author:** ![yanivab](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yanivab/32/9164_2.png) [@yanivab](https://discourse.julialang.org/u/yanivab)\
**Post date:** [July 26, 2019, 7:02pm UTC](https://discourse.julialang.org/t/cmdstan-jl-fails-on-documentation-example-path-issues/26023/2 "2019-07-26T19:02:28Z")

</div>

The problem was that stan doesn’t accept any spaces in paths. So setting the project directory, tmp directory and CmdStan directories to paths without spaces in them solved this.
