facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.08k stars 4.49k forks source link

Warning during installation with clean docker image #1976

Open Akkarine opened 2 years ago

Akkarine commented 2 years ago

Building on clean docker image python:3.9.6-buster

FROM python:3.9.6-buster

RUN pip install cython plotly numpy xlrd pandas requests pytz uuid matplotlib tqdm scikit-learn seaborn scipy \
    && pip install 'bokeh<2.0.0' \
    && pip install prophet
Warning log ```logs Collecting prophet Downloading prophet-1.0.1.tar.gz (65 kB) Requirement already satisfied: Cython>=0.22 in /usr/local/lib/python3.9/site-packages (from prophet) (0.29.24) Collecting cmdstanpy==0.9.68 Downloading cmdstanpy-0.9.68-py3-none-any.whl (49 kB) Collecting pystan~=2.19.1.1 Downloading pystan-2.19.1.1.tar.gz (16.2 MB) Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.9/site-packages (from prophet) (1.21.1) Requirement already satisfied: pandas>=1.0.4 in /usr/local/lib/python3.9/site-packages (from prophet) (1.3.1) Requirement already satisfied: matplotlib>=2.0.0 in /usr/local/lib/python3.9/site-packages (from prophet) (3.4.2) Collecting LunarCalendar>=0.0.9 Downloading LunarCalendar-0.0.9-py2.py3-none-any.whl (18 kB) Collecting convertdate>=2.1.2 Downloading convertdate-2.3.2-py3-none-any.whl (47 kB) Collecting holidays>=0.10.2 Downloading holidays-0.11.2-py3-none-any.whl (142 kB) Collecting setuptools-git>=1.2 Downloading setuptools_git-1.2-py2.py3-none-any.whl (10 kB) Requirement already satisfied: python-dateutil>=2.8.0 in /usr/local/lib/python3.9/site-packages (from prophet) (2.8.2) Requirement already satisfied: tqdm>=4.36.1 in /usr/local/lib/python3.9/site-packages (from prophet) (4.61.2) Collecting ujson Downloading ujson-4.0.2-cp39-cp39-manylinux1_x86_64.whl (179 kB) Requirement already satisfied: pytz>=2014.10 in /usr/local/lib/python3.9/site-packages (from convertdate>=2.1.2->prophet) (2021.1) Collecting pymeeus<=1,>=0.3.13 Downloading PyMeeus-0.5.11.tar.gz (5.4 MB) Collecting hijri-converter Downloading hijri_converter-2.1.3-py3-none-any.whl (14 kB) Collecting korean-lunar-calendar Downloading korean_lunar_calendar-0.2.1-py3-none-any.whl (8.0 kB) Requirement already satisfied: six in /usr/local/lib/python3.9/site-packages (from holidays>=0.10.2->prophet) (1.16.0) Collecting ephem>=3.7.5.3 Downloading ephem-4.0.0.2-cp39-cp39-manylinux2010_x86_64.whl (1.2 MB) Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.9/site-packages (from matplotlib>=2.0.0->prophet) (2.4.7) Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/site-packages (from matplotlib>=2.0.0->prophet) (0.10.0) Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/site-packages (from matplotlib>=2.0.0->prophet) (1.3.1) Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from matplotlib>=2.0.0->prophet) (8.3.1) Building wheels for collected packages: prophet, pymeeus, pystan Building wheel for prophet (setup.py): started Building wheel for prophet (setup.py): finished with status 'error' ERROR: Command errored out with exit status 1: command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-n3f90iz5 cwd: /tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/ Complete output (44 lines): running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/prophet creating build/lib/prophet/stan_model Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/setup.py", line 123, in setup( File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/local/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run self.run_command('build') File "/usr/local/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.9/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/local/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/setup.py", line 48, in run build_models(target_dir) File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/setup.py", line 36, in build_models from prophet.models import StanBackendEnum File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/prophet/__init__.py", line 8, in from prophet.forecaster import Prophet File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/prophet/forecaster.py", line 17, in from prophet.make_holidays import get_holiday_names, make_holidays_df File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/prophet/make_holidays.py", line 14, in import prophet.hdays as hdays_part2 File "/tmp/pip-install-qbsnyz58/prophet_4eb77a6d036e41b29b6e60177b757235/prophet/hdays.py", line 13, in from convertdate.islamic import from_gregorian, to_gregorian ModuleNotFoundError: No module named 'convertdate' ---------------------------------------- ERROR: Failed building wheel for prophet Running setup.py clean for prophet Building wheel for pymeeus (setup.py): started Building wheel for pymeeus (setup.py): finished with status 'done' Created wheel for pymeeus: filename=PyMeeus-0.5.11-py3-none-any.whl size=730983 sha256=ed96a75c810a83b4c7ca554bda4ddf621d98627e1c96e133ffc56b41c1e1c9bd Stored in directory: /root/.cache/pip/wheels/33/3d/82/4579e9cca41ff991140b2e050bc6df3a38292f26e4fa06b15d Building wheel for pystan (setup.py): started Building wheel for pystan (setup.py): still running... Building wheel for pystan (setup.py): still running... Building wheel for pystan (setup.py): finished with status 'done' Created wheel for pystan: filename=pystan-2.19.1.1-cp39-cp39-linux_x86_64.whl size=61829149 sha256=3348ac7ade5e2ccb74c14f93cdfe07ce390c3edab083f6f5b22c950cde5ad2b8 Stored in directory: /root/.cache/pip/wheels/b8/36/bf/7ec7e363f796373cea3eb9ea94e83f5bbbb586d2edbf7e3417 Successfully built pymeeus pystan Failed to build prophet Installing collected packages: pymeeus, ujson, korean-lunar-calendar, hijri-converter, ephem, convertdate, setuptools-git, pystan, LunarCalendar, holidays, cmdstanpy, prophet Running setup.py install for prophet: started Running setup.py install for prophet: still running... Running setup.py install for prophet: finished with status 'done' DEPRECATION: prophet was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ```

https://github.com/pypa/pip/issues/8368#issuecomment-888932590

tcuongd commented 2 years ago

Could you try to install pystan==2.19.1.1 first before installing Prophet? See https://github.com/facebook/prophet#installation-in-python Pystan is required to build the wheel for Prophet.

Akkarine commented 2 years ago

Thank you, that helped. But I've added also all other sub-dependencies:

...
    && pip install pymeeus ujson korean-lunar-calendar hijri-converter ephem convertdate setuptools-git pystan==2.19.1.1 LunarCalendar holidays cmdstanpy \
    && pip install prophet \
...