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.53k stars 4.54k forks source link

RHEL 8 - fbprophet not installed - INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW. #1765

Closed emrenak closed 3 years ago

emrenak commented 3 years ago

Trying to install fbprophet on RHEL 8. Already installed gcc and python dev tools, however compiling fails.

I'm using pystan pystan-2.19.1.1

gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Requirement already satisfied: Cython>=0.22 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: cmdstanpy==0.9.5 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: pystan>=2.14 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: numpy>=1.15.4 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: pandas>=1.0.4 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: matplotlib>=2.0.0 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: LunarCalendar>=0.0.9 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: convertdate>=2.1.2 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: holidays>=0.10.2 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: setuptools-git>=1.2 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: python-dateutil>=2.8.0 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: tqdm>=4.36.1 in ./.local/lib/python3.6/site-packages (from fbprophet) Requirement already satisfied: pytz>=2017.2 in /usr/lib/python3.6/site-packages (from pandas>=1.0.4->fbprophet) Requirement already satisfied: pillow>=6.2.0 in ./.local/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /usr/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) Requirement already satisfied: cycler>=0.10 in ./.local/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) Requirement already satisfied: kiwisolver>=1.0.1 in ./.local/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) Requirement already satisfied: ephem>=3.7.5.3 in ./.local/lib/python3.6/site-packages (from LunarCalendar>=0.0.9->fbprophet) Requirement already satisfied: pymeeus<=1,>=0.3.6 in ./.local/lib/python3.6/site-packages (from convertdate>=2.1.2->fbprophet) Requirement already satisfied: six in /usr/lib/python3.6/site-packages (from holidays>=0.10.2->fbprophet) Requirement already satisfied: korean_lunar_calendar in ./.local/lib/python3.6/site-packages (from holidays>=0.10.2->fbprophet) Installing collected packages: fbprophet Running setup.py install for fbprophet ... error Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-build-g90u7vaj/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-op19icq6-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_py creating build creating build/lib creating build/lib/fbprophet creating build/lib/fbprophet/stan_model Importing plotly failed. Interactive plots will not work. INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW. error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-build-g90u7vaj/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-op19icq6-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-g90u7vaj/fbprophet/

bletham commented 3 years ago

It looks like something isn't working in the C++ toolchain. A simple way to verify that is to try to run this pystan code:

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0

It looks like you have the python3-devel. I've also seen gcc64 and gcc64-c++ come up as necessary packages in red hat linux.

Some other things to check that may be helpful: #1403, #846, #326

emrenak commented 3 years ago

Tried to execute to code above as well. Any ideas ?

INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW. Traceback (most recent call last): File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 127, in _compile extra_postargs) File "/usr/lib64/python3.6/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/usr/lib64/python3.6/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/usr/lib64/python3.6/distutils/spawn.py", line 159, in _spawn_posix % (cmd, exit_status)) distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "test.py", line 3, in model = pystan.StanModel(model_code=model_code) # this will take a minute File "/home/adac/.local/lib/python3.6/site-packages/pystan/model.py", line 378, in init build_extension.run() File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/usr/lib64/python3.6/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 129, in _compile raise CompileError(msg) distutils.errors.CompileError: command 'gcc' failed with exit status 1

bletham commented 3 years ago

Yeah so there is definitely something still missing in the C++ toolchain, or the machine does not have enough RAM. Did you try the things described in the other issues?

emrenak commented 3 years ago

yes, tried, especially the one #1403, this one is very familiar with my problem. btw the server has 16 gb ram.

MemTotal: 16231480 kB

bletham commented 3 years ago

I don't think I have any ideas beyond what is described in the issues above, sorry. The only other thing I might try would be to downgrade pystan to 2.18.1, but that's a real shot in the dark. I think your best bet would be to ask over at Pystan if they have an idea of what's going on.

mikeosullivan8 commented 3 years ago

Did you solve this? I am having the same issue!

emrenak commented 3 years ago

Did you solve this? I am having the same issue!

No, unfortunately could not solve it.

octavd commented 3 years ago

Hey,

I had this problem also but i've managed to make it work with the following workaround.

Before installing fbprophet you have to install pystan.

However if you will install like this -> pip install pystan it will fail at building fbprophet because it will grab version 2.19.. that is not compatible with GCC version.

Solution:

pip install pystan==2.18.0.0

pip install fbprophet