2

I am getting the below mentioned error while installing fbprophet in the Windows environment, and, also setup.py is being triggered as part of installation as the installation using wheel file fails.

Installation of fbprophet library: Using legacy 'setup.py install' for fbprophet, since package 'wheel' is not installed

(new_venv) C:\Users\anno_user\Downloads\DocumentDB-Quickstart-Python>pip install fbprophet
Collecting fbprophet
  Using cached fbprophet-0.7.1.tar.gz (64 kB)
  Preparing metadata (setup.py) ... done

Using legacy 'setup.py install' for fbprophet, since package 'wheel' is not installed.
Installing collected packages: fbprophet
  Running setup.py install for fbprophet ... error
  error: subprocess-exited-with-error

And we are getting this following error when setup.py is installing the package:


  × Running setup.py install for fbprophet did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      running install
      c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: se
tup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\anno_user\AppData\Local\Temp\pip-install-hvgs_7ri\fbprophet_7865d66523254cabae59b7777322c65d\setup.py", line 149, in <module>
          long_description_content_type='text/markdown',
        File "C:\Users\anno_user\AppData\Local\Temp\pip-install-hvgs_7ri\fbprophet_7865d66523254cabae59b7777322c65d\fbprophet\models.py", line 209, in build_
model
          import pystan
        File "c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\lib\site-packages\pystan\__init__.py", line 9, in <module>
          from pystan.api import stanc, stan
        File "c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\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.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fbprophet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Please kindly suggest if there is any workaround (or) fix for the issue I am facing. Also, mention the python version along with the dependencies version for installing fbprophet from pypi.org.

nikhil int
  • 181
  • 2
  • 14
  • 1
    As far as I remember, you need Anaconda as it has a separate build system with its own C++ compiler. Using Anaconda should help. – annabitel Feb 26 '22 at 20:11
  • @annabednarsha, I feel so too, we are looking to install anaconda in a Linux environment to get around this error. – nikhil int Mar 02 '22 at 18:05

5 Answers5

2

These commands no longer work.

a) "fbprophet" is now "prophet"

b) need legacy versions of pystan and cmdstanpy

pystan=2.19.1.1 cmdstanpy=0.9.5

My Windows OS fails to install pystan=2.19.1.1 so I have given up. But "pip install prophet" works on both Google Collab and GCP Workbench.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31809433) – AlexK May 24 '22 at 02:16
1

Make sure you are using python 3.7 or 3.8

Harshal Deore
  • 1,050
  • 1
  • 11
  • 11
1

I also had issues with fbprophet in python=3.9. The reason is it required pystan and that requires c++ compiler. So, it was not working in both Vscode or anaconda.

Since it is upgraded to prophet,it is working fine now.

!pip install prophet
from prophet import Prophet

Assuming you have a pandas dataframe df with a datetime column named "ds" and a target column named "y", then:

model = Prophet()
model.fit(df)
Iftikhar Ud Din
  • 341
  • 3
  • 5
0

You can install Anaconda on Windows following this instruction and then run the following in Anaconda Prompt (as administrator):

conda install -c conda-forge gcc
conda install -c conda-forge pystan
conda install -c conda-forge fbprophet
annabitel
  • 112
  • 1
  • 1
  • 11
0

One workaround for this is to install 'prophet' module instead of 'fbprophet' and while importing import 'prophet' instead of 'fbprophet' so

python3 -m  pip install pystan
python3 -m  pip install prophet

or simply

pip install pystan
pip install prophet