EMS-TU-Ilmenau / fastmat

A library to build up lazily evaluated expressions of linear transforms for efficient scientific computing.
https://fastmat.readthedocs.io
Apache License 2.0
24 stars 8 forks source link

fastmat 0.2 seems to be incopatible with certain numpy versions #98

Closed JanKirchhofTU closed 3 years ago

JanKirchhofTU commented 3 years ago

When importing fastmat 0.2 with some "older" numpy versions I get the following error:

>>> import fastmat as fm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jan/.local/lib/python3.8/site-packages/fastmat/__init__.py", line 53, in <module>
    from .Matrix import Matrix, Hermitian, Conjugate, Transpose, flags
  File "fastmat/Matrix.pyx", line 1, in init fastmat.Matrix
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

The error occurs for the following numpy versions (these I checked)

Upgrading to the newest numpy version of 1.20.1 resolves the issue.

Setup

Debian python 3.8.1 fastmat 0.2

JanKirchhofTU commented 3 years ago

The problem only occurs when installing from pypi and not when compiling fastmat from source.

JanKirchhofTU commented 3 years ago

I would guess this causes the issue: https://numpy.org/doc/stable/release/1.20.0-notes.html#size-of-np-ndarray-and-np-void-changed