New to Pystan, Always get this error when attempting to sample: ModuleNotFoundError: No module named 'stanfit4anon_model...'

I am new to Pystan, and have been having incredible trouble getting simple models to sample.

I receive the error: ModuleNotFoundError: No module named ‘stanfit4anon_model…’

And then my Jupyter Notebook cell runs in perpetuity, until I restart the kernel.

Any advice helps! Thank you.

Hi, what OS do you have?

What does gcc --version say?
What Python and PyStan versions do you use?

Are you able to compile models?

Does sampling work with n_jobs=1

Thank you so much!

OS: Mac 10.15.4

gcc version:

Python version:
image

Is it conflicting that it says Clang 10.0.0 here? And Clang 12.0 in the gcc version?

Pystan version: 2.19.1.1

Able to compile models? - Yes!

Sampling with n_jobs = 1 – this worked! Thank you

What would be the best way to ensure I can run multiple chains at once?

Hi can you try this

import multiprocessing
multiprocessing.set_start_method("fork")
1 Like

This worked!

Thank you.