2

Hi I am a python newbie and am trying to install fbprophet within pycharm but am getting the following error. I have successfully installed pystan though.

Building wheels for collected packages: fbprophet
  Building wheel for fbprophet (setup.py): started
  Building wheel for fbprophet (setup.py): finished with status 'error'
  Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: fbprophet
  Running setup.py install for fbprophet: started
    Running setup.py install for fbprophet: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ankita.gupta\\AppData\\Local\\Temp\\pycharm-packaging\\fbprophet\\setup.py'"'"'; __file__='"'"'C:\\Users\\ankita.gupta\\AppData\\Local\\Temp\\pycharm-packaging\\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\ANKITA~1.GUP\AppData\Local\Temp\pip-wheel-9u7mn7vi' --python-tag cp37
       cwd: C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\
  Complete output (40 lines):
  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 "<string>", line 1, in <module>
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 120, in <module>
      """
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 44, in run
      build_stan_model(target_dir)
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 27, in build_stan_model
      from pystan import StanModel
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pystan\__init__.py", line 9, in <module>
      from pystan.api import stanc, stan
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pystan\api.py", line 13, in <module>
      import pystan._api  # stanc wrapper
  ImportError: DLL load failed: The specified module could not be found. 

Any ideas on how to resolve it, anyone? Many thanks in advance.

Prachi
  • 494
  • 3
  • 8
  • 21

2 Answers2

3

First you have to Install c++ compiler, you can install c++ compiler

pip install libpython m2w64-toolchain -c msys2

Once c++ compiler installed you have to install pystan, to install pystan you can use below command

pip install pystan

Finally, now we are ready to install facebook prophet

pip install fbprophet
skon7
  • 377
  • 3
  • 12
3

I had the same issue, while installing fbprophet on Windows10 Pycharm virtual environment...

Solved this by first uninstalling any pystan, fbprophet I had already installed:

pip uninstall pystan

pip uninstall fbprophet

Then re-install those libraries using python.exe:

#PyStan:

python.exe -m pip install pystan==2.17.1.0

#fbProphet0.6:

python.exe -m pip install fbprophet==0.6 

#Upgrade fbProphet:

python.exe -m pip install --upgrade fbprophet

If you follow this steps, prophet should be successfully installed!

Test the installation by importing the library from python terminal:

Python 3.7.3 

>>> import fbprophet
>>>

Source:Installing fbprophet Python on Windows 10