gatagat / lap

Linear Assignment Problem solver (LAPJV/LAPMOD).
BSD 2-Clause "Simplified" License
218 stars 68 forks source link

ValueError: numpy.ndarray has the wrong size #51

Closed mareksocha closed 1 year ago

mareksocha commented 1 year ago

Hi,

When I execute line: import lap

I got following error: from ._lapjv import ( File "__init__.pxd", line 199, in init lap._lapjv ValueError: numpy.ndarray has the wrong size, try recompiling. Expected 80, got 96

Environment: python 3.8 numpy==1.19.5

mareksocha commented 1 year ago

After testing I found out that installing the lap version 0.5.0 is not on the pip. Running following command solved my issue:

pip install git+https://github.com/gatagat/lap.git

Maybe it could be also solved by adjusting numpy version. But I have noticed that upgrading it to the numpy 1.24 would yeld np.long error because np.long has been marked deprecated in the 1.20 release and removed in the 1.24. Source: https://stackoverflow.com/questions/76389395/attributeerror-module-numpy-has-no-attribute-long