Can't deploy my fbprophet app in Streamlit share

Can’t deploy my fbprophet app in Streamlit share.

Error in the logs include:
ModuleNotFoundError: No module named ‘convertdate’
ERROR: Failed building wheel for fbprophet

But I have already included below in requirements.txt
convertdate
pystan==3.0.1
yfinance==0.1.55
streamlit==0.78.0
plotly==4.14.3
fbprophet==0.7.1

I suspect there are missing (apt) dependencies for fbprophet.
Unfortunately, I don’t know what is already included in the runtime engine of Streamlit sharing, but I would try to add a packages.txt file with the following content:

gcc
g++
build-essential
python3-dev

Thanks Franky1. I have tried to add packages.txt but no luck. Same error remain.

Please post the error messages.

Building wheels for collected packages: fbprophet, yfinance, multitasking, pymeeus, retrying
  Building wheel for fbprophet (setup.py): started
  Building wheel for fbprophet (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/appuser/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kv1szgx0
       cwd: /tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/
  Complete output (44 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/fbprophet
  creating build/lib/fbprophet/stan_model
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/setup.py", line 149, in <module>
      long_description_content_type='text/markdown',
    File "/home/appuser/venv/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/appuser/venv/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/setup.py", line 48, in run
      build_models(target_dir)
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/setup.py", line 36, in build_models
      from fbprophet.models import StanBackendEnum
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/fbprophet/__init__.py", line 8, in <module>
      from fbprophet.forecaster import Prophet
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/fbprophet/forecaster.py", line 17, in <module>
      from fbprophet.make_holidays import get_holiday_names, make_holidays_df
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/fbprophet/make_holidays.py", line 14, in <module>
      import fbprophet.hdays as hdays_part2
    File "/tmp/pip-install-w05a8ryc/fbprophet_7d26009f07a040a7b302a1320c1da0ed/fbprophet/hdays.py", line 13, in <module>
      from convertdate.islamic import from_gregorian, to_gregorian
  ModuleNotFoundError: No module named 'convertdate'
  ----------------------------------------
  ERROR: Failed building wheel for fbprophet

I am not sure where the problem is or if it is several problems at once.
The error messages show fbprophet and convertdate.
Is the app running locally? If so, on which system?

Furthermore, I would try to reduce or isolate the problems. Make a very simple app that only uses convertdate and try to deploy it. Then take a simple app that only uses fbprophet and try to deploy it.

Btw, please post any code or log messages in markdown format here for better readability:

```log
put your error messages here
```
1 Like

The app work as I have successfully deployed it in herokuapp before
https://my-stock-prediction.herokuapp.com/

Try to install via Anaconda for Streamlit Sharing.
It worked for me! :slight_smile:

Charly

1 Like