dswah / pyGAM

[HELP REQUESTED] Generalized Additive Models in Python
https://pygam.readthedocs.io
Apache License 2.0
852 stars 156 forks source link

When using s(): AttributeError: module 'numpy' has no attribute 'int'. #343

Closed olivermueller closed 4 months ago

olivermueller commented 5 months ago

When I try to use a spline term through s(), I get the following error message:

AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information. 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

dswah commented 5 months ago

i thought this was fixed in pygam v0.9.0!

which version of pygam are you using? can you please run

pip freeze | grep pygam

(there is another bug in pygam v0.9.0, so if you do python -c 'import pygam;print(pygam.__version__)' it will print 0.8.0)

olivermueller commented 5 months ago

Oh, seems like I am using 0.8.0. I just ran "pip install pygam" and did not check which version it installed. Because I'm running Python Python 3.12.1, it picked pygam 0.8.0.

dswah commented 5 months ago

Ok! i will add python 3.12 to the build tests to ensure that it works. this will require publishing a new release...

in the mean time. if you can use and older version of python, like 3.11, then you can already install pygam v0.9.0