hdbscan
hdbscan copied to clipboard
ValueError: numpy.ufunc size changed, may indicate binary incompatibility
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?
It seems upgrading numpy from 1.14.2
ro 1.16.0
resolved the issue.
Import error "from pmdarima.arima import auto_arima" anaconda 3.7 numpy version=1.15.4
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 upgrading for me to 1.16.1 finally fixed it!
pip install numpy==1.16.1
@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 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.
For anyone else looking, I believe this is the numpy issue on this problem: https://github.com/numpy/numpy/issues/12785
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==...
Error when I used version 1.16.3, downgrading to 1.16.0 addresses this issue ’‘’conda install numpy=1.16.0'''
This error needs to be solved the following way:
- Check your numpy version first using python -c "import numpy; print(numpy.version)"
- If it is higher than 1.16.0, uninstall numpy using sudo pip uninstall numpy
- Reinstall numpy using pip along with specifying version using sudo pip install numpy==1.16.1
This solved my problem.
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
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.
(https://user-images.githubusercontent.com/49805964/73639197-e4bcc480-4691-11ea-843f-3bf708bce66c.PNG)
This error needs to be solved the following way:
- Check your numpy version first using python -c "import numpy; print(numpy.version)"
- If it is higher than 1.16.0, uninstall numpy using sudo pip uninstall numpy
- 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
If you are working on a jupyter notebook, you might want to additionally restart your kernel.
- pip install numpy==1.16.1
- Restart Kernel
upgrade numpy version and solved pip install numpy==1.16.1
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