Skip to content

Problem with NumPy 1x and 2x version compatibility #53

@silviyahasana

Description

@silviyahasana

Is it possible for the devs to recompile brian2tools with NumPy 2.x ? Both brian2 and brian2tools were compiled using NumPy 1.x. But NumPy 1.x has long gone and most things are not working with NumPy 1.x anymore. Both brian2 and brian2tools installed through pip , if being used to unpack a pkl file, will lead to this error :

ModuleNotFoundError: No module named 'numpy._core.numeric'

It is because NumPy 1.x and 2.x have different formats and modules. Pkl files are now packed with NumPy 2.x formats, and some modules that are in NumPy 2.x are missing in NumPy 1.x. if I use any version of NumPy 2.x, this following error occurs :

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

This created a dependency hell between current NumPy 2.x and brian2 packages that require NumPy 1.x. It would be helpful if brian2 and brian2tools package through pip could be recompiled using NumPy 2.x.

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