Closed DaniJonesOcean closed 2 months ago
Posted related issue on DeepSensor repository:
https://github.com/alan-turing-institute/deepsensor/issues/118
Hey @DaniJonesOcean! Thanks for opening an issue. Let me look into this. I think there should be a simple fix by changing the import. I'll get back to you shortly.
@DaniJonesOcean This should be fixed in the latest release v1.6.6
.
Great, thanks for your quick work on this, @wesselb!
Summary
The
lab
package currently specifiesnumpy>=1.16
as a requirement, which leads to the installation of NumPy 2.0 when setting up a new environment or upgrading existing packages. Due to significant changes in NumPy 2.0, specifically the removal ofnp.sctypes
, thelab
package fails to import when used with the latest version of NumPy.Environment
Steps to Reproduce
lab
package with the latest version of NumPy:pip install 'numpy>=1.16' lab
(NumPy 2.0 will be installed).np.sctypes
, resulting in an AttributeError (e.g.import lab as B
)Expected Behavior
The
lab
package should be able to import successfully without any AttributeError regardingnp.sctypes
.Actual Behavior
An AttributeError is raised when importing the
lab
package with NumPy 2.0 installed:For example, when you try to import the deepsensor package, which uses the
lab
package:Suggested Solution
Temporarily restrict the version of NumPy in
setup.py
to prevent installation of incompatible versions. I suggest changing the requirement insetup.py
to: