Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy 1.24.2 and pmdarima 2.0.3 incompatibility #544

Closed
guilhermeeec opened this issue Apr 8, 2023 · 2 comments
Closed

numpy 1.24.2 and pmdarima 2.0.3 incompatibility #544

guilhermeeec opened this issue Apr 8, 2023 · 2 comments

Comments

@guilhermeeec
Copy link

Describe the bug

Hello,
I have numpy 1.24.2 and pmdarima 2.0.3 installed in my Ubuntu 20.04 LTS machine and, when I run some code that imports pmdarima, I have the following error:

>>> import pmdarima
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/pmdarima/__init__.py", line 52, in <module>
    from .arima import auto_arima, ARIMA, AutoARIMA, StepwiseContext, decompose
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/pmdarima/arima/__init__.py", line 7, in <module>
    from .auto import *
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/pmdarima/arima/auto.py", line 9, in <module>
    from sklearn.linear_model import LinearRegression
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/sklearn/linear_model/__init__.py", line 11, in <module>
    from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 34, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "/home/guiaraujo/.local/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

(notice that the error occurred in interactive shell, indicating that it does not depend on my code)

To Reproduce

Open a shell/bash terminal
Execute python3
Execute:
>>> import pmdarima

Versions

pip install numpy and pip install pmdarima in the latest versions (numpy 1.24.2 and pmdarima 2.0.3)

Expected Behavior

The import should work without any log messages and without any error.

Actual Behavior

The pmdarima import is raising an AttributeError after importing some numpy modules.

Additional Context

No response

@aaronreidsmith
Copy link
Member

aaronreidsmith commented Apr 8, 2023

What version of scikit-learn do you have installed? This only appears to be an issue on their 0.23.X and older releases. 0.24.X and newer have this issue resolved. FWIW, scikit-learn 0.24.0 was released in 2020.

@guilhermeeec
Copy link
Author

Thanks for the quick answer. It have upgraded scikit-learn to version 1.2.2 and now it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants