odlgroup / odl

Operator Discretization Library https://odlgroup.github.io/odl/
Mozilla Public License 2.0
374 stars 105 forks source link

AttributeError: module 'numpy' has no attribute 'object' #1628

Closed mehrhardt closed 1 year ago

mehrhardt commented 1 year ago

After updating ODL (to the most recent version) and numpy to 1.24.4 I cannot import ODL anymore.

The line https://github.com/odlgroup/odl/blob/0b088df8dc4621c68b9414c3deff9127f4c4f11d/odl/space/npy_tensors.py#L484C52-L484C52

is throwing the following error:

AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
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
mehrhardt commented 1 year ago

In a similar spirit:

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
mehrhardt commented 1 year ago

One option going forward is to tell pip that numpy has to be < 1.20. Not sure how to do that though. @ozanoktem?

mehrhardt commented 1 year ago

fixed by PR #1627