IBM/watson-stock-market-predictor

2.1: Fbprophet Setup code error

alessandromarialva opened this issue · 7 comments

Issue with matplotlib install, code shows ( matplotlib=3.0.2 )

!pip install --user pystan==2.17.1.0 holidays==0.9.8 setuptools-git==1.2 matplotlib=3.0.2 --upgrade

to fix the issue, just update to: ( matplotlib==3.0.2 )

!pip install --user pystan==2.17.1.0 holidays==0.9.8 setuptools-git==1.2 matplotlib==3.0.2 --upgrade

@alessandromarialva if you have the fix please send us a PR we will review and merge.

Thanks Sangeev, PR created:
Fbprophet Setup fix for matplotlib #1

@alessandromarialva I don't see the PR yet.

Sorry, it should be up now. Thanks!

new PR created and passed, thanks!

Hello, new to coding. Can you help with these errors? I really don't understand what I did wrong. As shown below, "Failed building wheel for fbprophet" followed by "fbprophet module not found".

2.1: Fbprophet Setup
Install required packages (this can take some minutes)
UPDATE(vnderlev): setuptools-git is now required for fbprophet 0.5.
!pip install --user pystan==2.17.1.0 holidays==0.9.8 setuptools-git==1.2 matplotlib==3.0.2 --upgrade
Collecting pystan==2.17.1.0
Downloading https://files.pythonhosted.org/packages/46/37/801a5a932e7f1f038542e7c5e4c4010aac19a26ea6bde9534505465f8c8c/pystan-2.17.1.0-cp36-cp36m-manylinux1_x86_64.whl (68.1MB)
|████████████████████████████████| 68.1MB 49.7MB/s eta 0:00:01
Collecting holidays==0.9.8
Downloading https://files.pythonhosted.org/packages/cc/da/7d0642a8b94ea413fc7005f4538c01475a45b420d705f57481752552ac55/holidays-0.9.8.tar.gz (64kB)
|████████████████████████████████| 71kB 25.6MB/s eta 0:00:01
Requirement already up-to-date: setuptools-git==1.2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (1.2)
Requirement already up-to-date: matplotlib==3.0.2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (3.0.2)
Requirement already satisfied, skipping upgrade: numpy>=1.7 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pystan==2.17.1.0) (1.15.4)
Requirement already satisfied, skipping upgrade: Cython!=0.25.1,>=0.22 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pystan==2.17.1.0) (0.29.5)
Requirement already satisfied, skipping upgrade: python-dateutil in /opt/conda/envs/Python36/lib/python3.6/site-packages (from holidays==0.9.8) (2.8.1)
Requirement already satisfied, skipping upgrade: six in /opt/conda/envs/Python36/lib/python3.6/site-packages (from holidays==0.9.8) (1.12.0)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib==3.0.2) (0.10.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib==3.0.2) (1.0.1)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib==3.0.2) (2.3.1)
Requirement already satisfied, skipping upgrade: setuptools in /opt/conda/envs/Python36/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib==3.0.2) (40.8.0)
Building wheels for collected packages: holidays
Building wheel for holidays (setup.py) ... done
Stored in directory: /home/dsxuser/.cache/pip/wheels/6f/d2/1a/5854fb5211d237db046d9ae62674a112d020d84c40a729dd02
Successfully built holidays
Installing collected packages: pystan, holidays
Found existing installation: pystan 2.19.1.1
Uninstalling pystan-2.19.1.1:
Successfully uninstalled pystan-2.19.1.1
Successfully installed holidays-0.9.8 pystan-2.17.1.0

Install fbprophet from pip (this will take some time, please be patient) !pip install fbprophet
Collecting fbprophet
Using cached https://files.pythonhosted.org/packages/1a/b5/9c3fefa8a7b839729df57deedf0a69815841dfb88f0df911f34d998230b7/fbprophet-0.7.1.tar.gz
Requirement already satisfied: Cython>=0.22 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (0.29.5)
Requirement already satisfied: cmdstanpy==0.9.5 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (0.9.5)
Requirement already satisfied: pystan>=2.14 in /home/dsxuser/.local/lib/python3.6/site-packages (from fbprophet) (2.17.1.0)
Requirement already satisfied: numpy>=1.15.4 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (1.15.4)
Requirement already satisfied: pandas>=1.0.4 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (1.1.4)
Requirement already satisfied: matplotlib>=2.0.0 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (3.0.2)
Requirement already satisfied: LunarCalendar>=0.0.9 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (0.0.9)
Requirement already satisfied: convertdate>=2.1.2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (2.3.0)
Collecting holidays>=0.10.2 (from fbprophet)
Requirement already satisfied: setuptools-git>=1.2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (1.2)
Requirement already satisfied: python-dateutil>=2.8.0 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (2.8.1)
Requirement already satisfied: tqdm>=4.36.1 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from fbprophet) (4.51.0)
Requirement already satisfied: pytz>=2017.2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pandas>=1.0.4->fbprophet) (2018.9)
Requirement already satisfied: cycler>=0.10 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (2.3.1)
Requirement already satisfied: ephem>=3.7.5.3 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from LunarCalendar>=0.0.9->fbprophet) (3.7.7.1)
Requirement already satisfied: pymeeus<=1,>=0.3.6 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from convertdate>=2.1.2->fbprophet) (0.3.7)
Requirement already satisfied: korean-lunar-calendar in /opt/conda/envs/Python36/lib/python3.6/site-packages (from holidays>=0.10.2->fbprophet) (0.2.1)
Requirement already satisfied: six in /opt/conda/envs/Python36/lib/python3.6/site-packages (from holidays>=0.10.2->fbprophet) (1.12.0)
Requirement already satisfied: setuptools in /opt/conda/envs/Python36/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->fbprophet) (40.8.0)
Building wheels for collected packages: fbprophet
Building wheel for fbprophet (setup.py) ... error
ERROR: Complete output from command /opt/conda/envs/Python36/bin/python -u -c 'import setuptools, tokenize;file='"'"'/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/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 /home/dsxuser/.tmp/pip-wheel-fusin54f --python-tag cp36:
ERROR: 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 "", line 1, in
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/setup.py", line 149, in
long_description_content_type='text/markdown',
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/opt/conda/envs/Python36/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/conda/envs/Python36/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/conda/envs/Python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
self.run_command('build')
File "/opt/conda/envs/Python36/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/conda/envs/Python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/conda/envs/Python36/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/conda/envs/Python36/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/conda/envs/Python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/setup.py", line 48, in run
build_models(target_dir)
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/setup.py", line 36, in build_models
from fbprophet.models import StanBackendEnum
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/fbprophet/init.py", line 8, in
from fbprophet.forecaster import Prophet
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/fbprophet/forecaster.py", line 17, in
from fbprophet.make_holidays import get_holiday_names, make_holidays_df
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/fbprophet/make_holidays.py", line 14, in
import fbprophet.hdays as hdays_part2
File "/home/dsxuser/.tmp/pip-install-efhwed5b/fbprophet/fbprophet/hdays.py", line 17, in
from holidays import WEEKEND, HolidayBase, Turkey
ImportError: cannot import name 'Turkey'

ERROR: Failed building wheel for fbprophet
Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: holidays, fbprophet
Found existing installation: holidays 0.9.8
Uninstalling holidays-0.9.8:
Successfully uninstalled holidays-0.9.8
Running setup.py install for fbprophet ... done
Successfully installed fbprophet-0.7.1 holidays-0.10.3

Import packages

import fbprophet
import datetime as dt

print('Packages imported.')

ModuleNotFoundError Traceback (most recent call last)
in
1 # Import packages
----> 2 import fbprophet
3 import datetime as dt
4
5 print('Packages imported.')

ModuleNotFoundError: No module named 'fbprophet'