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.53k stars 4.54k forks source link

Outdated numpy function #2609

Closed GabrielOttdeMedeiros closed 1 month ago

GabrielOttdeMedeiros commented 3 months ago

In the attached line of code, I get the following error: "`np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead." https://github.com/facebook/prophet/blob/36421b70f077cc657f143161de5a97f5a214e18b/python/prophet/forecaster.py#L459

Can someone please update this? I am trying to deploy my code in a container and I cannot edit this myself.

aeturrell commented 3 months ago

I'm having the same issue.

GabrielOttdeMedeiros commented 3 months ago

@aeturrell I am not sure if this will help you, but this is how I worked around my issue:

I created a python environment using specific library versions:

numpy==1.24.4 
matplotlib==3.7.2 
pandas==2.0.3 
scikit-learn==1.3.0

And then ran the following command in docker separately from the other libraries using prophet's recommended installation method, as seen in the attached link:

python -m pip install prophet

https://facebook.github.io/prophet/docs/installation.html#python:~:text=python%20%2Dm%20pip%20install%20prophet

So if you are using docker it will look something like this:

# Copy requirements.txt to container root directory
COPY prophet/requirements.txt ./

# Install dependencies
RUN pip3 install --no-cache-dir -r requirements.txt

RUN python -m pip install prophet
LachlanMarnham commented 3 months ago

If you need to be on numpy 2.x, you can monkeypatch it like:

import numpy as np
np.float_ = np.float64
import prophet

until a Prophet fix is released.

tisba commented 2 months ago

Fixed in https://github.com/facebook/prophet/pull/2592