joshlk / k-means-constrained

K-Means clustering - constrained with minimum and maximum cluster size. Documentation: https://joshlk.github.io/k-means-constrained
https://github.com/joshlk/k-means-constrained
BSD 3-Clause "New" or "Revised" License
192 stars 43 forks source link

Can't import K-means-constrained #13

Closed Soumaya787 closed 3 years ago

Soumaya787 commented 3 years ago

Hello, When I try to import the package, I get the following error :

 from k_means_constrained import KMeansConstrained
  File "C:\Users\Public\Anaconda3\lib\site-packages\k_means_constrained\__init__.py", line 4, in <module>
    from .k_means_constrained_ import KMeansConstrained
  File "C:\Users\Public\Anaconda3\lib\site-packages\k_means_constrained\k_means_constrained_.py", line 29, in <module>
    from k_means_constrained.mincostflow_vectorized import SimpleMinCostFlowVectorized
  File "C:\Users\Public\Anaconda3\lib\site-packages\k_means_constrained\mincostflow_vectorized.py", line 4, in <module>
    from ortools.graph.pywrapgraph import SimpleMinCostFlow
  File "C:\Users\Public\Anaconda3\lib\site-packages\ortools\graph\pywrapgraph.py", line 13, in <module>
    from . import _pywrapgraph
ImportError: DLL load failed while importing _pywrapgraph: Le module spécifié est introuvable.

These are the versions of the required packages:

Name: k-means-constrained
Version: 0.6.0 

Name: numpy
Version: 1.20.3

Name: scipy
Version: 1.6.3

Name: ortools
Version: 9.0.9048

Thanks in advance

joshlk commented 3 years ago

Hi @Soumaya787,

I can't reproduce your error. What operating system are you using?

The error also looks like it is originating from ortools and not k-means-constrained. Try reinstalling in a fresh environment to see if you still get the error. If the error persists it might be worth doing a bug report with ortools.

Josh