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.

Cannot install Prophet with Python 3.8

See original GitHub issue

Hello,

I am trying to install prophet using pip for Python 3.8 on centos 7 and i’m executing the commands from the readme:

pip install pystan==2.19.1.1 !pip install prophet

pystan installs successfully but for prophet i am getting the below error:

Collecting prophet Downloading prophet-1.0.1.tar.gz (65 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 KB 147.2 MB/s eta 0:00:00 Preparing metadata (setup.py) … done Requirement already satisfied: Cython>=0.22 in /opt/app-root/lib/python3.8/site-packages (from prophet) (0.29.19) Collecting cmdstanpy==0.9.68 Downloading cmdstanpy-0.9.68-py3-none-any.whl (49 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.0/49.0 KB 176.8 MB/s eta 0:00:00 Requirement already satisfied: pystan~=2.19.1.1 in /opt/app-root/lib/python3.8/site-packages (from prophet) (2.19.1.1) Requirement already satisfied: numpy>=1.15.4 in /opt/app-root/lib/python3.8/site-packages (from prophet) (1.22.1) Requirement already satisfied: pandas>=1.0.4 in /opt/app-root/lib/python3.8/site-packages (from prophet) (1.3.5) Requirement already satisfied: matplotlib>=2.0.0 in /opt/app-root/lib/python3.8/site-packages (from prophet) (3.2.1) 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.4.0-py3-none-any.whl (47 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.9/47.9 KB 221.8 MB/s eta 0:00:00 Collecting holidays>=0.10.2 Downloading holidays-0.12-py3-none-any.whl (165 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 165.6/165.6 KB 115.1 MB/s eta 0:00:00 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 /opt/app-root/lib/python3.8/site-packages (from prophet) (2.8.2) Requirement already satisfied: tqdm>=4.36.1 in /opt/app-root/lib/python3.8/site-packages (from prophet) (4.62.3) Collecting ujson Downloading ujson-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (44 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.1/44.1 KB 220.1 MB/s eta 0:00:00 Collecting pymeeus<=1,>=0.3.13 Downloading PyMeeus-0.5.11.tar.gz (5.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.4/5.4 MB 163.1 MB/s eta 0:00:00 Preparing metadata (setup.py) … done Collecting hijri-converter Downloading hijri_converter-2.2.2-py3-none-any.whl (13 kB) Collecting korean-lunar-calendar Downloading korean_lunar_calendar-0.2.1-py3-none-any.whl (8.0 kB) Collecting ephem>=3.7.5.3 Downloading ephem-4.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 285.7 MB/s eta 0:00:00 Requirement already satisfied: pytz in /opt/app-root/lib/python3.8/site-packages (from LunarCalendar>=0.0.9->prophet) (2021.3) Requirement already satisfied: cycler>=0.10 in /opt/app-root/lib/python3.8/site-packages (from matplotlib>=2.0.0->prophet) (0.11.0) Requirement already satisfied: kiwisolver>=1.0.1 in /opt/app-root/lib/python3.8/site-packages (from matplotlib>=2.0.0->prophet) (1.3.2) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/app-root/lib/python3.8/site-packages (from matplotlib>=2.0.0->prophet) (2.4.7) Requirement already satisfied: six>=1.5 in /opt/app-root/lib/python3.8/site-packages (from python-dateutil>=2.8.0->prophet) (1.16.0) Building wheels for collected packages: prophet, pymeeus Building wheel for prophet (setup.py) … error error: subprocess-exited-with-error

Γ— python setup.py bdist_wheel did not run successfully. β”‚ exit code: 1 ╰─> [45 lines of output] running bdist_wheel running build running build_py Note: NumExpr detected 16 cores but β€œNUMEXPR_MAX_THREADS” not set, so enforcing safe limit of 8. NumExpr defaulting to 8 threads. Traceback (most recent call last): File β€œ<string>”, line 2, in <module> File β€œ<pip-setuptools-caller>”, line 34, in <module> File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/setup.py”, line 123, in <module> setup( File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/init.py”, line 155, in setup return distutils.core.setup(**attrs) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/core.py”, line 148, in setup return run_commands(dist) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/core.py”, line 163, in run_commands dist.run_commands() File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/dist.py”, line 967, in run_commands self.run_command(cmd) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File β€œ/opt/app-root/lib64/python3.8/site-packages/wheel/bdist_wheel.py”, line 299, in run self.run_command(β€˜build’) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/command/build.py”, line 135, in run self.run_command(cmd_name) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File β€œ/opt/app-root/lib64/python3.8/site-packages/setuptools/_distutils/dist.py”, line 986, in run_command cmd_obj.run() File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/setup.py”, line 48, in run build_models(target_dir) File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/setup.py”, line 36, in build_models from prophet.models import StanBackendEnum File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/prophet/init.py”, line 8, in <module> from prophet.forecaster import Prophet File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/prophet/forecaster.py”, line 17, in <module> from prophet.make_holidays import get_holiday_names, make_holidays_df File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/prophet/make_holidays.py”, line 14, in <module> import prophet.hdays as hdays_part2 File β€œ/tmp/pip-install-n5fjoi3p/prophet_7818b294e7554a689cd75c32cf61b67c/prophet/hdays.py”, line 13, in <module> from convertdate.islamic import from_gregorian, to_gregorian ModuleNotFoundError: No module named β€˜convertdate’ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for prophet Running setup.py clean for prophet Building wheel for pymeeus (setup.py) … done Created wheel for pymeeus: filename=PyMeeus-0.5.11-py3-none-any.whl size=730985 sha256=d28d4dc8caee712708bb790e547406e801e97f96d0a672aa54382dfd5707233c Stored in directory: /tmp/pip-ephem-wheel-cache-91qtl_6l/wheels/a0/8b/b2/810ae5a6f970c8be4725353400d643c90de1c0f023a9884ee7 Successfully built pymeeus Failed to build prophet Installing collected packages: setuptools-git, pymeeus, korean-lunar-calendar, ephem, ujson, hijri-converter, convertdate, LunarCalendar, holidays, cmdstanpy, prophet Running setup.py install for prophet … error error: subprocess-exited-with-error

Γ— Running setup.py install for prophet did not run successfully. β”‚ exit code: 1 ╰─> [9 lines of output] running install /opt/app-root/lib64/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py Note: NumExpr detected 16 cores but β€œNUMEXPR_MAX_THREADS” not set, so enforcing safe limit of 8. NumExpr defaulting to 8 threads. COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW. error: Command β€œgcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I/tmp/pystan__31_63t9 -I/opt/app-root/lib64/python3.8/site-packages/pystan -I/opt/app-root/lib64/python3.8/site-packages/pystan/stan/src -I/opt/app-root/lib64/python3.8/site-packages/pystan/stan/lib/stan_math -I/opt/app-root/lib64/python3.8/site-packages/pystan/stan/lib/stan_math/lib/eigen_3.3.3 -I/opt/app-root/lib64/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0 -I/opt/app-root/lib64/python3.8/site-packages/pystan/stan/lib/stan_math/lib/sundials_4.1.0/include -I/opt/app-root/lib64/python3.8/site-packages/numpy/core/include -I/opt/app-root/include -I/opt/rh/rh-python38/root/usr/include/python3.8 -c /tmp/pystan__31_63t9/stanfit4anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec_5404811383420624219.cpp -o /tmp/pystan__31_63t9/tmp/pystan__31_63t9/stanfit4anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec_5404811383420624219.o -O2 -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++1y” failed with exit status 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

Γ— Encountered error while trying to install package. ╰─> prophet

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

Could you please advise?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
octavdcommented, Feb 11, 2022

Problem solved! It was because the gcc version installed was 4.8.5 and in order to compile successfully, prophet needs gcc 4.9.3 or higher. With the below code it worked.

FROM centos/python-38-centos7:latest USER root RUN yum -y update RUN yum -y install centos-release-scl RUN yum -y install devtoolset-7-gcc* SHELL [ "/usr/bin/scl", "enable", "devtoolset-7"] RUN gcc --version pip install prophet

0reactions
GordonDongZHAOcommented, May 27, 2022

do this first: yum -y install python3.8-dev

Read more comments on GitHub >

github_iconTop Results From Across the Web

error when running pip install fbprophet #1775 - GitHub
Hi, I tried to run pip install fbprophet on docker: FROM public.ecr.aws/lambda/python:3.8 RUN pip --no-cache-dir install \ ephem \ pystanΒ ...
Read more >
Installation | Prophet - Meta Open Source
After installation, you can get started! Experimental backend - cmdstanr. You can also choose an experimental alternative stan backend called cmdstanr .
Read more >
Unable to install prophet - python - Stack Overflow
I'm trying to install fbprophet and it is failing. ... Try using python 3.8 I failed to work prophet in python 3.9 but...
Read more >
Installing FBProphet/Prophet for Time Series Forecasting in ...
The main problem of the installation, in my case because I already installed python 3.9 so, the prophet can't be installed. I don't...
Read more >
Cant install python package fbprophet - pystan failing? - Replit
Pystan 2.19.1.1 is required for fbprophet and cannot be installed due to compile error. Possible solution is to install python-dev package, but it's...
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