facebook/prophet

Outdated numpy function

GabrielOttdeMedeiros opened this issue · 4 comments

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."

) -> NDArray[np.float_]:

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

I'm having the same issue.

@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

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.

Fixed in #2592