2

I am tying to install Fbprophet (python)

I followed all installation instructions (anaconda).

If I try to run Fbprophet in my anaconda prompt it works fine.

However, when I create a project in Visual studio 2017 I get the following error message:

Traceback (most recent call last): File "C:\Users\dommarch\source\repos\FbProphet\FbProphet\FbProphet.py", line 1, in import fbprophet File "C:\Users\dommarch\AppData\Local\Continuum\anaconda2\envs\python36\lib\site-packages\fbprophet__init__.py", line 8, in from fbprophet.forecaster import Prophet File "C:\Users\dommarch\AppData\Local\Continuum\anaconda2\envs\python36\lib\site-packages\fbprophet\forecaster.py", line 17, in import pystan # noqa F401 File "C:\Users\dommarch\AppData\Roaming\Python\Python36\site-packages\pystan__init__.py", line 9, in from pystan.api import stanc, stan File "C:\Users\dommarch\AppData\Roaming\Python\Python36\site-packages\pystan\api.py", line 13, in import pystan._api # stanc wrapper ImportError: DLL load failed: %1 is not a valid Win32 application.

If anyone has an idea it would be awesome.

Thanks

1 Answers1

0

The version of (fb)prophet, pystan and python are important.

I managed to get it working for this stack:

CentOS: 7
Python: 3.8
GCC: 4.8.5
PyStan: 2.19.1.1
FbProphet: 0.7.1

And for this particular stack, you need GCC++ 2014 compiler, provided by this package:

centos-release-scl devtoolset-8

For Windows, using conda, python 3.8, steps are documented in this article and will summarize below:

  • Access anaconda using conda command in your command line

  • Build new virtual environment e.g. time_series, this environment will run in Python 3.8,

    conda create -n time_series python=3.8
    
  • Access your environment using this command:

    conda activate time_series
    
  • Install the C++ compiler:

    conda install libpython m2w64-toolchain -c msys2
    
  • Installation of the dependencies of fbprophet:

    conda install numpy cython -c conda-forge

    conda install matplotlib scipy pandas -c conda-forge

    conda install pystan -c conda-forge

    conda install -c anaconda ephem

  • Install the library that will used for your time series forecasting environment:

    pip install scikit-learn

    pip install --user pmdarima

    conda install -c conda-forge fbprophet

Note: Fbprophet was renamed to Prophet https://github.com/facebook/prophet/issues/1874

So, you may need to install prophet too:

   pip install pystan==2.19.1.1 prophet

or

   conda install -c conda-forge prophet