biocore / biom-format

The Biological Observation Matrix (BIOM) Format Project
http://biom-format.org
Other
92 stars 95 forks source link

Numpy compatibility issue #974

Open Midnighter opened 3 months ago

Midnighter commented 3 months ago

When I install biom-format and numpy >= 2 in an environment, I get a lot of errors of the sort:

ValueError('numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject')

That is even though, version 2.1.16 promises numpy 2.0 compatibility.

I think, the reason is that you do not restrict the numpy version in your build instructions and your wheels are compiled against numpy <2.

[build-system]
requires = ["setuptools","wheel", "numpy", "cython"]
wasade commented 3 months ago

Thanks, could you issue a PR to trigger CI?On Aug 4, 2024, at 17:04, Moritz E. Beber @.***> wrote: When I install biom-format and numpy >= 2 in an environment, I get a lot of errors of the sort: ValueError('numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject')

That is even though, version 2.1.16 promises numpy 2.0 compatibility. I think, the reason is that you do not restrict the numpy version in your build instructions and your wheels are compiled against numpy <2. [build-system] requires = ["setuptools","wheel", "numpy", "cython"]

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Midnighter commented 3 months ago

I can, but the nasty side-effect of that will be loss of compatibility with numpy <2. Is that what the project wants?

wasade commented 3 months ago

It isn’t but would like to see what happens. I’m OOO for the next few weeks so cannot look close, but would greatly appreciate any effort that could be contributed for numpy 1 and 2 supportOn Aug 4, 2024, at 17:58, Moritz E. Beber @.***> wrote: I can, but the nasty side-effect of that will be loss of compatibility with numpy <2. Is that what the project wants?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

iBuitron commented 3 months ago

same here but when installing with poetry:

  File "/home/reveur/python/environmental/quickBio/ed.py", line 1, in <module>
    import biom
  File "/home/reveur/python/environmental/quickBio/.venv/lib/python3.11/site-packages/biom/__init__.py", line 51, in <module>
    from .table import Table
  File "/home/reveur/python/environmental/quickBio/.venv/lib/python3.11/site-packages/biom/table.py", line 196, in <module>
    from ._filter import _filter
  File "biom/_filter.pyx", line 1, in init biom._filter
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

(this installation comming from scikit-bio using poetry)

NOTE: if i installing with pip, it works fine.

Report on Scikit-bio forum: https://github.com/scikit-bio/scikit-bio/issues/2101