prophet: [Python] Error when running fit(): Library not loaded: '@rpath/libtbb.dylib'
When running Prophet().fit() on a Mac (Monterey 12.5.1, Apple M1 Max Chip), I get the following error message:
cmdstanpy - ERROR - Chain [1] error: terminated by signal 6 Unknown error: -6
Traceback (most recent call last):
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/tests/test_prophet.py", line 67, in <module>
test_prophet()
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/tests/test_prophet.py", line 29, in test_prophet
model.fit(df)
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/.venv/lib/python3.8/site-packages/prophet/forecaster.py", line 1171, in fit
self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/.venv/lib/python3.8/site-packages/prophet/models.py", line 112, in fit
raise e
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/.venv/lib/python3.8/site-packages/prophet/models.py", line 102, in fit
self.stan_fit = self.model.optimize(**args)
File "/Users/xxx/xxx/xxx/xxx/xxx/xxx/.venv/lib/python3.8/site-packages/cmdstanpy/model.py", line 731, in optimize
raise RuntimeError(msg)
RuntimeError: Error during optimization: console log output:
dyld[29330]: Library not loaded: '@rpath/libtbb.dylib'
Referenced from: '/Users/xxx/xxx/xxx/xxx/xxx/xxx/.venv/lib/python3.8/site-packages/prophet/stan_model/prophet_model.bin'
Reason: tried: '/private/var/folders/h2/rc68jj_17r1dp8c05qbhlr500000gn/T/pip-req-build-lk5m800e/build/lib.macosx-10.14-arm64-cpython-38/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib' (no such file), '/private/var/folders/h2/rc68jj_17r1dp8c05qbhlr500000gn/T/pip-req-build-lk5m800e/build/lib.macosx-10.14-arm64-cpython-38/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib' (no such file), '/usr/local/lib/libtbb.dylib' (no such file), '/usr/lib/libtbb.dylib' (no such file)
I ran my code in VSCode and used poetry add prophet to install prophet in my project’s env. This is prophet v1.1. Any ideas or help are welcome.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 15
- Comments: 20
here’s how I got this working with homebrew python@3.11, might be similar for venv and other homebrew versions
https://gist.github.com/thewisenerd/52f937d01b06287ccf21a05a118e74ad
The same issue on M1 using v1.1
After doing some digging I found a workable setup. I was previously running python
3.10. Per #2002, the following configuration works with M1:3.8.130.9.681.0.12.19.1.1Prophet
1.1does not seem compatible with python3.10with the M1 chip.Having
python 3.9.16andprophet==1.1, this solved the issue on M1:and my tests passed successfully as on linux. so it’s broken on M1 but fixable, no need to downgrade
prophet😎thx for the suggestions! The fix of thewisenerd worked as suggested:
Having
python 3.10.8andprophet==1.1.2on a M1.Can you tell when this issue will be solved? I cant work with prophet on my m1 mac because of this issue
Got this working on my py venv on Mac M1 (as per @thewisenerd 's suggestion)
Configuration
stan_modellibrary is installed (from your venv directory)Got this working on
python 3.10, andprophet==1.1.2on my M1 Pro Macbook using the last line of @thewisenerd’s solution:In my case I was using a
poetryenvironment so I just had to go to my virtualenv’sprophetinstallation folder.The above worked for me using
python 3.11.0 (installed using pyenv),poetry==1.2.2,cmdstanpy==1.0.8,prophet==1.1.1. Instead of looking in thehomebrewdirectory forstan_model, look at the virtualenv of where prophet was installed: