question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Python] Error when running fit(): Library not loaded: '@rpath/libtbb.dylib'

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:7

github_iconTop GitHub Comments

5reactions
rjafaraucommented, Aug 20, 2022

The same issue on M1 using v1.1

3reactions
thewisenerdcommented, Nov 16, 2022

here’s how I got this working with homebrew python@3.11, might be similar for venv and other homebrew versions

cd /opt/homebrew/lib/python3.11/site-packages/prophet/stan_model
install_name_tool -add_rpath @executable_path/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb prophet_model.bin

https://gist.github.com/thewisenerd/52f937d01b06287ccf21a05a118e74ad

Read more comments on GitHub >

github_iconTop Results From Across the Web

dyld[3169]: Library not loaded: @rpath/libtbb.dylib
I am trying to use prophet on python to ...
Read more >
xcode14:Library not loaded: /usr/l… | Apple Developer Forums
The underlying issue creating these crashes on older OS versions is resolved in Xcode 14.1 RC, available today. For apps built using any...
Read more >
DYLD not loading when running root within python script
Hi When I try to run a python shell script, like: subprocess.call('. ... dyld: Library not loaded: @rpath/libCore.so Referenced from: ...
Read more >
[MacOS] Library not loaded: @rpath/libtbb.dylib
The problem happens only on MacOS platform, and it didn't appear when I was using UE4. I have never heard of this libtbb...
Read more >
V error: dyld: Library not loaded: @rpath/libstdc++.6.dylib
Hi Kevin, You are right, I am trying to use conda to install/run NCL; I forgot to mention that in my first message....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found