deprecated NumPy !!!

2,528 views
Skip to first unread message

Pekka Hurskainen

unread,
Oct 9, 2023, 5:00:28 AM10/9/23
to Trends.Earth Users

Dear trends.earth list and developers,


When trying to import custom land productivity data (JRC LPD type), I get the following error (which has been reported by many others in this group earlier). I cannot proceed to SDG 15.3.1 calculation without this step.


I guess this would be rather easy to solve, but a bigger question is what is going with trends.earth development?? No updates, bug fixes since February 2023.


An error has occurred while executing Python code:

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
...

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


Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.30.0-'s-Hertogenbosch 's-Hertogenbosch, f186b8efe0e 

Noureddine Aribi

unread,
Oct 17, 2023, 5:27:56 AM10/17/23
to Trends.Earth Users
 Hello,

I encountered the same problem, which appears to be caused by an incompatibility issue with numpy (v1.24+).

To resolve this, you can try the following steps:

1 - Depending on your QGIS version (I'm using QGIS 3.28.11 in my case), open a CMD prompt as an administrator (this is important) and navigate to the following folder:
C:\Program Files\QGIS 3.28.11

2 - Check the current numpy version:
pip show numpy

If you see that numpy version is 1.24, it's likely the cause of the problem, and you should consider downgrading it to version 1.23.

3 - To downgrade numpy to version 1.23.0, use the following commands:
pip3 uninstall numpy
pip install numpy==1.23.0

These steps should help resolve the issue.

Best regards,
--
Noureddine Aribi
Reply all
Reply to author
Forward
0 new messages