Cannot install Prophet with Python 3.8
See original GitHub issueHello,
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:
- Created 2 years ago
- Comments:5
Top GitHub Comments
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
do this first: yum -y install python3.8-dev