AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.. Did you mean: 'float16'?
from prophet import Prophet
File "/opt/python/3.12.1/lib/python3.12/site-packages/prophet/__init__.py", line 7, in <module>
from prophet.forecaster import Prophet
File "/opt/python/3.12.1/lib/python3.12/site-packages/prophet/forecaster.py", line 28, in <module>
class Prophet(object):
File "/opt/python/3.12.1/lib/python3.12/site-packages/prophet/forecaster.py", line 459, in Prophet
) -> NDArray[np.float_]:
^^^^^^^^^
File "/opt/python/3.12.1/lib/python3.12/site-packages/numpy/__init__.py", line 397, in __getattr__
raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.. Did you mean: 'float16'?
can not import prophet
version:
Requirement already satisfied: prophet in /opt/python/3.12.1/lib/python3.12/site-packages (1.1.5)
Requirement already satisfied: pandas in /opt/python/3.12.1/lib/python3.12/site-packages (2.2.2)
Requirement already satisfied: numpy in /opt/python/3.12.1/lib/python3.12/site-packages (2.0.0)
Hello,
I solved this issue for myself to replace the np.float_ with the suggestes np.float64 instead.
File prophet/forecaster.py
@staticmethod def fourier_series( dates: pd.Series, period: Union[int, float], series_order: int, ) -> NDArray[~~np.float_~~ -> np.float64]:
It would be then necessary to add numpy>=2.0.X in the requirements.
Would this solve #2595?
Also duplicate with #2588 in my opinion :)
@mrogocki yeah changing it in the forecaster.py fixed it for now.
Thanks.
adding this before importing prophet works for me
import numpy as np
np.float_ = np.float64
from prophet import Prophet
@kjdeveloper8 order really matters!
import numpy as np
from prophet import Prophet
np.float_ = np.float64 # AttributeError: np.float_ was removed in the NumPy 2.0 release. Use np.float64 instead.
Thank you so much.
adding this before importing prophet works for me
import numpy as np np.float_ = np.float64 from prophet import Prophet
Fixed in https://github.com/facebook/prophet/pull/2592