numpy.ndarray binary incompatibility error in environments with `numpy<1.20`
See original GitHub issueAfter upgrading sisl to 0.11.0 I can not import the package anymore.
The call:
from sisl._indices import indices_le
returns:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
OS Fedora 31 Python 3.7.6 numpy 1.17.5 (and others, see below)
Tried to reinstall numpy (same version) as suggested on the web, but couldn’t solve the problem. I am bound to this old numpy version due to other packages requirement, but I also tried in a new environment (same python version) numpy 1.18 and 1.19. Got the same error. Version of numpy 1.20, on the contrary, works.
Issue Analytics
- State:
- Created 3 years ago
- Comments:33 (23 by maintainers)
Top Results From Across the Web
ValueError: numpy.ndarray size changed, may indicate binary ...
I'm in Python 3.8.5. It sounds too simple to be real, but I had this same issue and all I did was reinstall...
Read more >ValueError: numpy.ndarray size changed, may indicate binary ...
The "ValueError: numpy.ndarray size changed, may indicate binary incompatibility" occurs because there was a change in NumPy's C API in version ...
Read more >FAQ — MMDetection3D 0.17.3 documentation
If you face the error shown below when importing pycocotools: ValueError: numpy.ndarray size changed, may indicate binary incompatibility.
Read more >Release notes — NumPy v1.24 Manual
Deprecations · Deprecate fastCopyAndTranspose and PyArray_CopyAndTranspose · Compatibility notes · array. · New Features · New attribute symbol added to ...
Read more >TensorFlow and Numpy Issue M1 | Apple Developer Forums
This error may indicate that you're trying to pass a Tensor to a NumPy call ... ValueError: numpy.ndarray size changed, may indicate binary...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, you are correct, it is basically the same as you suggest.
I think I just fixed this. sisl only has a build requirement for the oldest numpy version available for the current python version. And once runned it requires a specific version. I just committed f364af06be2aa1854d8205bcad24c84efc598db8 which removed my extraneous requirement in
requires
! That variable is only a build requirement.I have now fixed it and tested some cases.
I am pretty sure (fingers crossed) that this is resolved for any later releases.
@pfebrer please have a look at the latest commit message and the file
developments/test_numpy_installs.sh
which tests a few things. You’ll note that this one will fail for v0.11.0 (due to not having proper build-dependencies) but will work regardless in the latest commits.There were some things that needed updating, but I think this is on the right track.
Again, for future reference, one should be able to install sisl without problems if you pre-install the dependencies, and then subsequently install sisl with the
--no-build-isolation
to forcefully use the currently used versions:Note that if users manually install older numpy versions that do not follow the uploaded wheels for numpy, this procedure will fail and one really has to use the
--no-build-isolation
option.I’ll close this, please re-open if not fixed.