EnMAP-Box / enmap-box

EnMAP-Box source code repository. See https://enmap-box.readthedocs.io for documentation
GNU General Public License v3.0
35 stars 16 forks source link

AttributeError:module 'numpy' has no attribute 'float'. #604

Closed jakimowb closed 10 months ago

jakimowb commented 10 months ago

Several module still use statements like np.float, which fail with recent numpy versions:

This warning is show for the following EnMAPBoxApplications, but likely more modules are affected

Tested on macOS

EnMAPBoxApplication error(s): 
bivariatecolorrasterrendererapp: 
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
Traceback:
File "/Users/jakimowb/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/applications.py", line 353, in addApplicationFolder
appModule = importlib.import_module(appPkgName)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/jakimowb/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/coreapps/bivariatecolorrasterrendererapp/__init__.py", line 1, in 
from bivariatecolorrasterrendererapp.bivariatecolorrasterrendererdialog import BivariateColorRasterRendererDialog
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/jakimowb/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/coreapps/bivariatecolorrasterrendererapp/bivariatecolorrasterrendererdialog.py", line 6, in 
from bivariatecolorrasterrendererapp.bivariatecolorrasterrenderer import BivariateColorRasterRenderer
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/jakimowb/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/coreapps/bivariatecolorrasterrendererapp/bivariatecolorrasterrenderer.py", line 9, in 
from sklearn.decomposition import PCA
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/sklearn/decomposition/__init__.py", line 17, in 
from .dict_learning import dict_learning
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/sklearn/decomposition/dict_learning.py", line 5, in 
from . import _dict_learning # type: ignore
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in 
from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/sklearn/linear_model/__init__.py", line 11, in 
from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/sklearn/linear_model/_least_angle.py", line 34, in 
method='lar', copy_X=True, eps=np.finfo(np.float).eps,
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numpy/__init__.py", line 305, in __getattr__
raise AttributeError(__former_attrs__[attr])
janzandr commented 10 months ago

Can't find anything in the current DEV. Please re-open if requiered and point to an accual code line,