Skip to content

numpy 2.4 compatibility #647

Closed
Closed

Description

@juntyr

basemap 2.0.0 depends on numpy <2.4, could the bound be increased to include 2.4? Thanks!

Activity

  1. wreckdump commented on Jan 13, 2026

    @wreckdump

    Having same problem with python <3.14 and with numpy 2.4.1.

  2. DavidVadnais commented on May 1, 2026

    @DavidVadnais

    From yaml (below)

    name: temp
    channels:
      - conda-forge
    dependencies:
      - python  # includes pip
      - numpy
      - basemap
    conda env create -f temp.yml 
    
    cat ~/micromamba/envs/temp/lib/python3.14/site-packages/basemap-2.0.0.dist-info/METADATA | grep -i numpy
    
    Requires-Dist: numpy<2.4,>=2.0

    and python says (yes I activated conda env temp)

    import numpy
    numpy.__version__
    '2.4.3'

    then

    pip install basemap
    ...
    Downloading numpy-2.3.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.6 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.6/16.6 MB 3.6 MB/s  0:00:04
    Installing collected packages: numpy
      Attempting uninstall: numpy
        Found existing installation: numpy 2.4.3
        Uninstalling numpy-2.4.3:
          Successfully uninstalled numpy-2.4.3
    Successfully installed numpy-2.3.5

    Notably conda is unaware of this change so

    conda list | grep -i numpy                                                                                               
      numpy             2.4.3         py314h2b28147_0       conda-forge
  3. wreckdump commented on May 1, 2026

    @wreckdump

    From yaml (below)

    name: temp
    channels:

    • conda-forge
      dependencies:
    • python # includes pip
    • numpy
    • basemap

    conda env create -f temp.yml

    cat ~/micromamba/envs/temp/lib/python3.14/site-packages/basemap-2.0.0.dist-info/METADATA | grep -i numpy

    Requires-Dist: numpy<2.4,>=2.0

    and python says (yes I activated conda env temp)

    import numpy
    numpy.version
    '2.4.3'

    then

    pip install basemap
    ...
    Downloading numpy-2.3.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.6 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.6/16.6 MB 3.6 MB/s 0:00:04
    Installing collected packages: numpy
    Attempting uninstall: numpy
    Found existing installation: numpy 2.4.3
    Uninstalling numpy-2.4.3:
    Successfully uninstalled numpy-2.4.3
    Successfully installed numpy-2.3.5

    Notably conda is unaware of this change so

    conda list | grep -i numpy
    numpy 2.4.3 py314h2b28147_0 conda-forge

    So, are you saying that basemap works on conda environement? Thanks.

  4. DavidVadnais commented on May 1, 2026

    @DavidVadnais

    @wreckdump Conda will pull numpy 2.4 and ignore the pypi pin of [2.0, 2.3]

    Then if you try to pip install it will downgrade numpy. If you only use conda it should work.

    This should be resolved between these prs:
    #648
    conda-forge/basemap-feedstock#156
    conda-forge/conda-forge-repodata-patches-feedstock#1194

  5. DavidVadnais commented on May 3, 2026

    @DavidVadnais

    Testing after the the merge requests (below) were merged. Looks like the versions are pinned to match as expected.

    conda-forge/basemap-feedstock#156
    conda-forge/conda-forge-repodata-patches-feedstock#1194

    from yaml

    name: temp
    channels:
      - conda-forge
    dependencies:
      - python  # includes pip
      - numpy
      - basemap
    conda env create -f tmp.yaml
    
    cat ~/micromamba/envs/temp/lib/python3.14/site-packages/basemap-2.0.0.dist-info/METADATA | grep -i numpy
    Requires-Dist: numpy<2.4,>=2.0
    import numpy
    >>> numpy.__version__
    '2.3.5'

    Finally

     pip install basemap
    ...
    Requirement already satisfied: numpy<2.4,>=2.0 in /$PYTHON_PATH/python3.14/site-packages (from basemap) (2.3.5)
    ...
    
  6. thebaptiste commented on May 3, 2026

    @thebaptiste

    But the issue was to ask for a new release of basemap with numpy 2.4 compatibility (regardless conda) ! Don't you intend to do it ?

  7. DavidVadnais commented on May 3, 2026

    @DavidVadnais

    I'm happy to help but I think its already done.

    #648

    Is there anything I can do that isn't covered in the @juntyr's pr?

  8. thebaptiste commented on May 4, 2026

    @thebaptiste

    It's done by #648 but this pull request has not been approved...

  9. molinav commented on May 4, 2026

    @molinav
    Member

    I have just merged the associated PR, sorry for the delay.

    I will try to find some time this week to look at the other open PRs and prepare a new patch release.

  10. thebaptiste commented on Aug 10, 2026

    @thebaptiste

    Still no new release with numpy 2.4 compatibility... Maybe you could release a 2.0.1 with this only fix ?

    By the way a numpy 2.5 compatibility would also be great !

  11. wreckdump commented on Aug 10, 2026

    @wreckdump

    Still no new release with numpy 2.4 compatibility... Maybe you could release a 2.0.1 with this only fix ?

    By the way a numpy 2.5 compatibility would also be great !

    In my case, I just edited the setup.py and pyproject.toml to have numpy and python version that includes numpy 2.5 and python 3.14. I know this is a shady solution, but for me it is working without any problems when I am using basemap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions