scikit-learn-contrib / hdbscan

A high performance implementation of HDBSCAN clustering.
http://hdbscan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.8k stars 502 forks source link

Error message when importing hdbscan #537

Open ivan-marroquin opened 2 years ago

ivan-marroquin commented 2 years ago

Hi,

Many thanks for such great package!

I have Python 3.8.10 on a Windows machine. I installed hdbscan 0.8.27, below is the installation log: pip install hdbscan==0.8.27 Collecting hdbscan==0.8.27 Using cached hdbscan-0.8.27-cp38-cp38-win_amd64.whl Requirement already satisfied: six in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (1.15.0) Requirement already satisfied: cython>=0.27 in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (0.29.23) Requirement already satisfied: numpy>=1.16 in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (1.19.5) Requirement already satisfied: scikit-learn>=0.20 in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (0.22) Requirement already satisfied: scipy>=1.0 in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (1.7.3) Requirement already satisfied: joblib>=1.0 in c:\temp\python_3.8.10\lib\site-packages (from hdbscan==0.8.27) (1.0.1) Installing collected packages: hdbscan Successfully installed hdbscan-0.8.27

When I import hdbscan, I get the following error message: Traceback (most recent call last): File "test_hdbscan_clustering.py", line 9, in import hdbscan File "C:\Temp\Python3.8.10\lib\site-packages\hdbscan__init__.py", line 1, in from .hdbscan import HDBSCAN, hdbscan File "C:\Temp\Python3.8.10\lib\site-packages\hdbscan\hdbscan.py", line 21, in from ._hdbscan_linkage import (single_linkage, File "hdbscan/_hdbscan_linkage.pyx", line 1, in init hdbscan._hdbscan_linkage ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject

Any suggestions?

Kind regards,

Ivan

JanRhoKa commented 2 years ago

Had the same error while developing the package. Uninstalling Numpy and reinstalling it using conda-forge solved the issue:

conda uninstall numpy
y
conda config --env --add channels conda-forge
conda install numpy

This was done in the Terminal of PyCharm 2021.2.3

ivan-marroquin commented 2 years ago

Hi @JanRhoKa

Many thanks for the suggestion. I don't have a Conda installation, just a Python installation. And I tried your approach. Unfortunately, I still got the same issue. Then, I removed and installed hdbscan 0.8.27, and got the same issue.

Do you have another suggestion?

Ivan