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.02k stars 4.48k forks source link

Won't install on windows 10 with conda or pip #1506

Closed jmrichardson closed 4 years ago

jmrichardson commented 4 years ago

Hi,

I have performed the steps for installing on windows outlined here.

Conda shows that fbrpophet is installed but cannot import it

(freetrade) D:\Projects>conda list fbprophet
# packages in environment at D:\Anaconda3\envs\freetrade:
#
# Name                    Version                   Build  Channel
fbprophet                 0.6              py37h6538335_0    conda-forge

(freetrade) D:\Projects>which python
/cygdrive/d/Anaconda3/envs/freetrade/python

(freetrade) D:\Projects>python
Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 22:22:21) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'fbprophet'
>>> 

I am getting this error message when trying to using pip


(freetrade) D:\Projects>conda list fbprophet
# packages in environment at D:\Anaconda3\envs\freetrade:
#
# Name                    Version                   Build  Channel
fbprophet                 0.6              py37h6538335_0    conda-forge

(freetrade) D:\Projects>which python
/cygdrive/d/Anaconda3/envs/freetrade/python

(freetrade) D:\Projects>python
Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 22:22:21) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'fbprophet'
>>>

(freetrade) D:\Projects>
(freetrade) D:\Projects>
(freetrade) D:\Projects>pip install fbprophet
Collecting fbprophet
  Using cached fbprophet-0.6.tar.gz (54 kB)
Requirement already satisfied: Cython>=0.22 in d:\anaconda3\lib\site-packages (from fbprophet) (0.29.18)
Requirement already satisfied: cmdstanpy==0.4 in d:\anaconda3\lib\site-packages (from fbprophet) (0.4.0)
Requirement already satisfied: pystan>=2.14 in d:\anaconda3\lib\site-packages (from fbprophet) (2.19.1.1)
Requirement already satisfied: numpy>=1.10.0 in d:\anaconda3\lib\site-packages (from fbprophet) (1.18.1)
Requirement already satisfied: pandas>=0.23.4 in d:\anaconda3\lib\site-packages (from fbprophet) (1.0.3)
Requirement already satisfied: matplotlib>=2.0.0 in d:\anaconda3\lib\site-packages (from fbprophet) (3.1.3)
Requirement already satisfied: LunarCalendar>=0.0.9 in d:\anaconda3\lib\site-packages (from fbprophet) (0.0.9)
Requirement already satisfied: convertdate>=2.1.2 in d:\anaconda3\lib\site-packages (from fbprophet) (2.2.1)
Requirement already satisfied: holidays>=0.9.5 in d:\anaconda3\lib\site-packages (from fbprophet) (0.10.2)
Requirement already satisfied: setuptools-git>=1.2 in d:\anaconda3\lib\site-packages (from fbprophet) (1.2)
Requirement already satisfied: python-dateutil>=2.8.0 in d:\anaconda3\lib\site-packages (from fbprophet) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in d:\anaconda3\lib\site-packages (from pandas>=0.23.4->fbprophet) (2020.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in d:\anaconda3\lib\site-packages (from matplotlib>=2.0.0->fbprophet) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\anaconda3\lib\site-packages (from matplotlib>=2.0.0->fbprophet) (1.2.0)
Requirement already satisfied: cycler>=0.10 in d:\anaconda3\lib\site-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: ephem>=3.7.5.3 in d:\anaconda3\lib\site-packages (from LunarCalendar>=0.0.9->fbprophet) (3.7.7.1)
Requirement already satisfied: pymeeus<=1,>=0.3.6 in d:\anaconda3\lib\site-packages (from convertdate>=2.1.2->fbprophet) (0.3.7)
Requirement already satisfied: korean-lunar-calendar in d:\anaconda3\lib\site-packages (from holidays>=0.9.5->fbprophet) (0.2.1)
Requirement already satisfied: six in d:\anaconda3\lib\site-packages (from holidays>=0.9.5->fbprophet) (1.14.0)
Building wheels for collected packages: fbprophet
  Building wheel for fbprophet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Anaconda3\envs\freetrade\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\john\\AppData\\Local\\Temp\\pip-install-l2or0v92\\fbprophet\\setup.py'"'"'; __file__='"'"'C:\\Users\\john\\AppData\\Local\\Temp\\pip-install-l2or0v92\\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 'C:\Users\john\AppData\Local\Temp\pip-wheel-5xx3pjle'
       cwd: C:\Users\john\AppData\Local\Temp\pip-install-l2or0v92\fbprophet\
  Complete output (10 lines):
  running bdist_wheel
  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_ad32c37d592cdbc572cbc332ac6d2ee2 NOW.
  error: command 'D:\\Anaconda3\\envs\\freetrade\\Library\\mingw-w64\\bin\\g++.exe' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for fbprophet

Thanks for any help

jmrichardson commented 4 years ago

I got it to work the conda installation. It's weird because I have never had to do this with any other conda package installation. Essentially, I had to append the directory of the fbprophet package directory to sys.path:

sys.path.append('D:\Anaconda3\envs\freetrade\Lib\site-packages')