facebook / facebook/prophet

access denied to prophet/stan_model/prophet_model.bin

Open
#2,243 5 comments 2 reactions 0 assignees View on GitHub
install py
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

Hello everyone,

Need your helps to resolve an issue when installing and packaging prophet library to use it for aws lambda layer.
I already do this work twice with python3.5 and python3.6. But for now in python 3.9 ,
I have the below problem **to access to prophet/stan_model/prophet_model.bin** when calling prophet library in my aws lambda.
I try installation with pip3.9 and sudo pip3.9 but I have the same issue. But , i have good import because when i do

import prophet
print(dir(prophet))

**I have :**
(['Prophet', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'diagnostics', 'forecaster', 'hdays', 'make_holidays', 'models', 'plot']

I do this work on :

1. linux Debian -amd64 (4.9.320-2 (2022-06-30) x86_64)
2. python3.9
3. prophet 1.1

**So thanks a lot for your help:**
**NB : I install it on the linux machine and it works well . It is only when i use it on aws lambda that i have this issue**

[ERROR] RuntimeError: Failed with error [Errno 13] Permission denied: '/tmp/prophet/prophet/stan_model/prophet_model.bin'

Traceback (most recent call last):
File "/var/task/lambda_function.py", line 51, in lambda_handler
import test_fb
File "/var/task/test_fb.py", line 12, in
m.fit(df)
File "/tmp/prophet/prophet/forecaster.py", line 1171, in fit
self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
File "/tmp/prophet/prophet/models.py", line 110, in fit
self.stan_fit = self.model.optimize(**args)
File "/tmp/prophet/cmdstanpy/model.py", line 724, in optimize
self._run_cmdstan(runset, dummy_chain_id, show_console=show_console)
File "/tmp/prophet/cmdstanpy/model.py", line 1603, in _run_cmdstan
raise RuntimeError(msg) from e

![prophet_issue](https://user-images.githubusercontent.com/47027790/183123480-69cc3670-d1b8-43eb-a8d9-23b257ec6d91.PNG)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.