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.

Error: package or namespace load failed for ‘prophet’ in dyn.load(file, DLLpath = DLLpath, ...)

See original GitHub issue

Great package. I have integrated into modeltime (R package that uses prophet with tidymodels ecosystem). It’s working great.

I did run into one issue when using on MacOS (Windows I have not experienced this problem). I’ve referenced the issue business-science/modeltime#20.

Problem

MacOS seems to have an issue (sometimes???) when loading prophet.

> library(prophet)
Loading required package: Rcpp
Loading required package: rlang
Error: package or namespace load failed for ‘prophet’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/prophet/libs/prophet.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/prophet/libs/prophet.so, 6): Library not loaded: @rpath/libtbb.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/prophet/libs/prophet.so
  Reason: image not found

Solution

The easiest way to fix is to load StanHeaders. This sets the C++ flags and libraries, which seems to solve the missed libtbb.dylib path.

How I solved it with modeltime:

Add StanHeaders to Imports image

Somewhere in the package import StanHeaders.

image

The same solution will work for prophet.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
mdancho84commented, Sep 8, 2020

Hey @seanjtaylor & @bletham - I checked and this fixes the issues. Thanks for merging. I just had another student with the same issue.

3reactions
mdancho84commented, Aug 19, 2020

Hey Ben,

Yes - I can do this. I know it will work because I’ve been doing it manually:

library(StanHeaders)
library(prophet)

Works fine on my machine. And all StanHeaders does is generate the C++ bindings for Rcpp & Stan (so it’s super lightweight).

I have a stacked schedule but hopefully by weekend I can send a PR addressing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error loading prophet library in R - How can I fix it?
library(prophet) > Error: package or namespace load failed for 'prophet' > in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared > object ......
Read more >
Error loading prophet library in R - How can I fix it?
library(prophet) > Error: package or namespace load failed for 'prophet' > in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared ...
Read more >
Error: package or namespace load failed for 'DESeq2' in ...
I tried to download the "locfit" package but I can't find it anywhere. What do you think is the problem? DESeq2 • 3.8k...
Read more >
问答- 腾讯云开发者社区-腾讯云
... Loading required package: Rcpp Loading required package: rlang Error: package or namespace load failed for 'prophet' in dyn.load(file, DLLpath = DLLpath ......
Read more >
[Solved]-Installing mclust package problem. ...
Installation is preparing for lazy loading and never finishes-R. ... package or namespace load failed for 'stringi' in dyn.load(file, DLLpath = DLLpath, ....
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