hdbscan icon indicating copy to clipboard operation
hdbscan copied to clipboard

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

Open ixxie opened this issue 6 years ago • 17 comments

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 avatar Jan 14 '19 08:01 ixxie

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

ixxie avatar Jan 14 '19 10:01 ixxie

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

LL-Jan avatar Apr 03 '19 06:04 LL-Jan

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

hovikgas avatar Apr 16 '19 23:04 hovikgas

@hovikgas upgrading for me to 1.16.1 finally fixed it!

pip install numpy==1.16.1

odb2 avatar Apr 18 '19 07:04 odb2

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

hovikgas avatar Apr 19 '19 16:04 hovikgas

@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.

odb2 avatar Apr 20 '19 01:04 odb2

For anyone else looking, I believe this is the numpy issue on this problem: https://github.com/numpy/numpy/issues/12785

ben-albrecht avatar Jun 03 '19 14:06 ben-albrecht

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==...

digulla avatar Jun 07 '19 12:06 digulla

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

jinliangXX avatar Jun 26 '19 03:06 jinliangXX

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.

anerisheth19 avatar Sep 23 '19 17:09 anerisheth19

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

serbinsh avatar Sep 23 '19 17:09 serbinsh

It doesn’t work☹ Pls check the log for detail, any suggestion is welcomed!


发件人: Shawn P. Serbin [email protected] 发送时间: Tuesday, September 24, 2019 1:59:16 AM 收件人: scikit-learn-contrib/hdbscan [email protected] 抄送: Subscribed [email protected] 主题: Re: [scikit-learn-contrib/hdbscan] ValueError: numpy.ufunc size changed, may indicate binary incompatibility (#272)

I also solved this issue by installing numpy==1.16.1

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/scikit-learn-contrib/hdbscan/issues/272?email_source=notifications&email_token=AHXZMSSZQF3CCRYRCOBRVITQLD7XJA5CNFSM4GPXFRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7LXIXY#issuecomment-534213727, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHXZMSVNAKTNUXKVRW6L2FTQLD7XJANCNFSM4GPXFRNQ.

EngineTai avatar Sep 25 '19 10:09 EngineTai

(https://user-images.githubusercontent.com/49805964/73639197-e4bcc480-4691-11ea-843f-3bf708bce66c.PNG)

Jyothif avatar Feb 03 '20 09:02 Jyothif

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

eustomaqua avatar Feb 04 '20 01:02 eustomaqua

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

LangeJustin avatar Mar 30 '20 14:03 LangeJustin

upgrade numpy version and solved pip install numpy==1.16.1

mamunctg avatar Aug 09 '20 08:08 mamunctg

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

Ravikumar-Pawar avatar Jan 24 '21 09:01 Ravikumar-Pawar