prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Outdated numpy function

Open GabrielOttdeMedeiros opened this issue 1 year ago • 3 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." 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.

GabrielOttdeMedeiros avatar Aug 09 '24 20:08 GabrielOttdeMedeiros

I'm having the same issue.

aeturrell avatar Aug 14 '24 17:08 aeturrell

@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

GabrielOttdeMedeiros avatar Aug 14 '24 17:08 GabrielOttdeMedeiros

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.

LachlanMarnham avatar Aug 15 '24 16:08 LachlanMarnham

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

tisba avatar Sep 11 '24 09:09 tisba