Stan and aws sagemaker

Hi all,

I wonder if anyone has played with stan (rstan/pystan/cmdstan*) on aws sagemaker. We are thinking about moving our stan related workflow there and would love to hear your experience!

Many thanks,


I’m not sure, but hopefully this will get more eyes on your question:


I’m going through the same situation.
The company where I work recently moved to AWS Sagemaker, giving us access to Jupyter Notebooks.
I’ve been trying to install cmdstan through cmdstanpy but still haven’t been able to avoid the “Need to set TBB_CXX_TYPE for non-standard compiler other than gcc or clang.”

Please share your experience in case you were able to install it well.

My colleague was able to install cmdstanpy on sagemaker STUDIO notebook earlier this year. We have since migrated away from aws but the following had worked for us.

os.environ['CMDSTAN'] = './cmdstan-2.23.0'

# check path
from cmdstanpy import CmdStanModel, cmdstan_path

!pip install cmdstanpy
!conda install cmdstanpy

tgz_file = 'colab-cmdstan-2.23.0.tar.gz

tgz_url = ' dev/cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz'

urllib.request.urlretrieve(tgz_url, tgz_file)

1 Like