Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: numpy.ufunc size changed, may indicate binary incompatibility #272

Open
ixxie opened this issue Jan 14, 2019 · 17 comments
Open

Comments

@ixxie
Copy link

ixxie commented Jan 14, 2019

Not entirely sure HDBSCAN is at fault here (maybe we broke something in our environment), but the latest build of our container exhibited the following error, which seems to trace into HDBSCAN:

File "/myfile.py", line 32, in <module>
     import hdbscan
   File "/usr/local/lib/python3.6/site-packages/hdbscan/__init__.py", line 1, in <module>
     from .hdbscan_ import HDBSCAN, hdbscan
   File "/usr/local/lib/python3.6/site-packages/hdbscan/hdbscan_.py", line 21, in <module>
     from ._hdbscan_linkage import (single_linkage,
   File "__init__.pxd", line 918, in init hdbscan._hdbscan_linkage
 ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

Any clues?

@ixxie
Copy link
Author

ixxie commented Jan 14, 2019

It seems upgrading numpy from 1.14.2 ro 1.16.0 resolved the issue.

@LL-Jan
Copy link

LL-Jan commented Apr 3, 2019

Import error "from pmdarima.arima import auto_arima"
anaconda 3.7 numpy version=1.15.4

@hovikgas
Copy link
Contributor

hovikgas commented Apr 16, 2019

I have numpy 1.16.2 and I still get the error. I installed it fine through command line using pip, but upon importing it, in both JupyterLab and Terminal, I get the following error:

ValueError                                Traceback (most recent call last)
<ipython-input-2-3f5a460d7435> in <module>
----> 1 import hdbscan

~/anaconda3/lib/python3.7/site-packages/hdbscan/__init__.py in <module>
----> 1 from .hdbscan_ import HDBSCAN, hdbscan
      2 from .robust_single_linkage_ import RobustSingleLinkage, robust_single_linkage
      3 from .validity import validity_index
      4 from .prediction import approximate_predict, membership_vector, all_points_membership_vectors
      5 

~/anaconda3/lib/python3.7/site-packages/hdbscan/hdbscan_.py in <module>
     19 from scipy.sparse import csgraph
     20 
---> 21 from ._hdbscan_linkage import (single_linkage,
     22                                mst_linkage_core,
     23                                mst_linkage_core_vector,

__init__.pxd in init hdbscan._hdbscan_linkage()

ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

@odb2
Copy link

odb2 commented Apr 18, 2019

@hovikgas upgrading for me to 1.16.1 finally fixed it!

pip install numpy==1.16.1

@hovikgas
Copy link
Contributor

hovikgas commented Apr 19, 2019

@odbarragan I'm already on 1.16.2... so I should downgrade to 1.16.1? That would likely mess up some other packages...

@odb2
Copy link

odb2 commented Apr 20, 2019

@hovikgas Yes downgrading to 1.16.1 worked for me so that may work for you as well. You might have to do pip uninstall numpy until there are no versions of numpy left and then do pip install numpy==1.16.1.

@ben-albrecht
Copy link

For anyone else looking, I believe this is the numpy issue on this problem: numpy/numpy#12785

@digulla
Copy link

digulla commented Jun 7, 2019

I'm seeing 7 of those warnings when creating docs using Sphinx.
I get the warning for the following numpy versions:
1.16.0, 1.16.1, 1.16.2, 1.16.3 and 1.16.4
I don't get the warning for:
1.15.1, 1.15.3, 1.15.4

I'm on Ubuntu 18.04.2 LTS and I've installed numpy using pip install numpy==...

@jinliangXX
Copy link

Error when I used version 1.16.3, downgrading to 1.16.0 addresses this issue
’‘’conda install numpy=1.16.0'''

@anerisheth19
Copy link

This error needs to be solved the following way:

  1. Check your numpy version first using python -c "import numpy; print(numpy.version)"
  2. If it is higher than 1.16.0, uninstall numpy using sudo pip uninstall numpy
  3. Reinstall numpy using pip along with specifying version using sudo pip install numpy==1.16.1

This solved my problem.

@serbinsh
Copy link

serbinsh commented Sep 23, 2019

I also solved this issue by installing numpy==1.16.1

I was on 1.13.1 or some such

RHEL 6.10, python3.6.2

@EngineTai
Copy link

EngineTai commented Sep 25, 2019 via email

@eustomaqua
Copy link

eustomaqua commented Feb 4, 2020

This error needs to be solved the following way:

  1. Check your numpy version first using python -c "import numpy; print(numpy.version)"
  2. If it is higher than 1.16.0, uninstall numpy using sudo pip uninstall numpy
  3. Reinstall numpy using pip along with specifying version using sudo pip install numpy==1.16.1

This solved my problem.

I attempted to use "pip install numpy==1.16.1" (or 1.16.4, 1.16.5, 1.16.0), none of them worked.
Could you please tell me more about which part in numpy will raise this warning? Thanks
@anerisheth19

@LangeJustin
Copy link

If you are working on a jupyter notebook, you might want to additionally restart your kernel.

  1. pip install numpy==1.16.1
  2. Restart Kernel

@mamunctg
Copy link

mamunctg commented Aug 9, 2020

upgrade numpy version and solved
pip install numpy==1.16.1

@Ravikumar-Pawar
Copy link

yes, uninstall the existing NumPy and install a higher version i.e latest version of NumPy can solve this issue
*pip uninstall numpy --user
*pip install numpy==1.16.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests