matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
771 stars 390 forks source link

Numpy 2.0 Compatibility #604

Open jbpezent opened 1 month ago

jbpezent commented 1 month ago

The recently released numpy 2.0 appears to be incompatible with latest basemap version 1.4.1. Seems to be a common issue with packages compiled against older versions of numpy. Issue observed on windows 11 with python 3.9 when importing basemap.

BaseMapError

DWesl commented 1 month ago

As I recall, the fix for this would be adding metadata to the effect of requires: numpy<2.0 to existing binary wheels and (re-)compiling new binary wheels with numpy>=2.0.

In the meantime, installing basemap from source with pip install --force-reinstall --no-binary :all: basemap should work until basemap does a new release with new binaries (1.4.1post1 might be fastest, but the maintainers might be close enough to 1.4.2 to wait for that).

valeriupredoi commented 3 weeks ago

@DWesl I can just go open a PR at feedstock with the new pin, and create a new build, in the meantime, if you OK with that? If basemap does indeed support numpy>=2.0.0 at upstream (here), that is :beer: