Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fbprophet installation error - failed building wheel for fbprophet

I am trying to install fbprophet for Python using Pip install, but failing. I have already installed Pystan.

Can I import it using Anaconda Navigator?

Can someone please help.

Failed building wheel for fbprophet

Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: fbprophet
  Running setup.py install for fbprophet ... error
    Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SJ-Admin\\AppData\\Local\\Temp\\pip-build-bsm4sxla\\fbprophet\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\SJ-Admin\AppData\Local\Temp\pip-kvck8fw1-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\fbprophet
    creating build\lib\fbprophet\stan_models
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 126, in <module>
        """
      File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 46, in run
        build_stan_models(target_dir)
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 28, in build_stan_models
        from pystan import StanModel
    ImportError: cannot import name 'StanModel'
like image 534
DataScience2017 Avatar asked Apr 18 '18 00:04

DataScience2017


3 Answers

Fundamental step: Switch to your environment in your Anaconda prompt: conda activate name-of-your-python-enviornment

Then the following steps shall work:

  1. On Prompt install Ephem:

    conda install -c anaconda ephem
    
  2. Install Pystan:

    conda install -c conda-forge pystan
    
  3. Finally install Fbprophet:

    conda install -c conda-forge fbprophet
    
  4. If exists error from holidays package

    pip install holidays==0.9.12
    

Reference: https://github.com/facebook/prophet/issues/892

Reference for Holiday package error: https://github.com/facebook/prophet/issues/1300

like image 149
Chethan Avatar answered Nov 08 '22 14:11

Chethan


Use offline package installer: this works with Python 3.8. and Python 3.9.x

pip install localpip 
localpip install fbprophet
like image 5
Alex BOURG Avatar answered Nov 08 '22 14:11

Alex BOURG


I could install fbprophet using conda install -c conda-forge fbprophet. This was failing too due to permission issue My folder had 'read-only' permissions. I modified it to read-write. Then reran the command and was able to install fbprophet

like image 3
DataScience2017 Avatar answered Nov 08 '22 13:11

DataScience2017