Getting runtimeerror: ERROR when running cmdstanpy tutorial on google colab

I am running the basic “hello world” tutorial for cmdstanpy found here. The problem I have is that I cannot access the sample summary. I get the following error.

RuntimeError: ERROR
 The following argument was not expected: --csv_file=/tmp/tmpijc0jg81/stansummary-bernoulli-4-chain-nzo5wr_y.csv
Run with --help for more information. 

Here is the code I use, it’s copy pasted from the tutorial. I also want to note that I did not have this problem yesterday and earlier in the week with other models. I am also using cmdstanpy in google colabs. Alternatively I tried to run the code in a new colab notebook and got the same error so I have a suspicion it might be a colab problem, but I am not really sure. The version of cmdstanpy I was using earlier this week and today is 0.9.5


from cmdstanpy import cmdstan_path, CmdStanModel

bernoulli_stan = os.path.join(cmdstan_path(), 'examples', 'bernoulli', 'bernoulli.stan')

bernoulli_model = CmdStanModel(stan_file=bernoulli_stan)

bernoulli_model.name

bernoulli_model.stan_file

bernoulli_model.exe_file

bernoulli_model.code()

bernoulli_data = os.path.join(cmdstan_path(), 'examples', 'bernoulli', 'bernoulli.data.json')
bern_fit = bernoulli_model.sample(data=bernoulli_data, output_dir='.')

bern_fit.summary()
1 Like

ah I solved my problem! I had to update cmdstanpy to the latest version in google colab. Colab default is cmdstanpy 0.9.5 and after I updated, I was at cmdstanpy 0.9.75.

This fixed all of my issues and lets me use cmdstan 2.26.1 now!

1 Like