Comments (15)
Hi all, thanks for using k-means-constrained 🚀!
Sorry for the long wait. I have updated the package on PyPI - can you please try the new version pip install --upgrade k-means-constrained
should do the trick (make sure it installs the v0.7.0 version). What I did was bump numpy up as I think its due to binary incompatibility between versions.
If the problem still persists can you please make sure the numpy version installed is 1.21.5
and let me know if that solves the issue.
from k-means-constrained.
@danvip10 I've updated the k-means-constrained
version. Can you please create a new virtual environment. Something like:
python3 -m venv ~/venv_test
source ~/venv_test/bin/activate
And then install the new version
from k-means-constrained.
I am experiencing the same issue as above, with the error message returned being:
numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
I am running on Databricks with Python 3.8.10
from k-means-constrained.
Hi, I'm also getting this same error. Has anyone found a solution?
Running Python 3.8.10.
from k-means-constrained.
Hi @joshlk, unfortunately I just upgraded to to k-means-constrained v0.7.0
and I still get exactly the same error... I do have numpy 1.21.5
.
As posted by @Warren-S5 the errror is ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
from k-means-constrained.
Can you please downgrade numpy to 1.21.5
to see if it resolves the issue. I would recommend doing this in a virtual environment
from k-means-constrained.
By the way numpy 1.25.5
currently does not exist 🤔 (see PyPI). The current latest version is 1.22.3
. Can you paste me the result of python -c "import numpy; print(numpy.__version__)"
from k-means-constrained.
sorry that was a typo, I meant numpy 1.21.5
from k-means-constrained.
Ok can you please provide me with the following versions:
- Python:
- Operating system: [Windows/MacOS/Linux]
- numpy:
- cython (if installed):
from k-means-constrained.
Python 3.8.10
Operating system: Ubuntu 20.04.3 LTS (Focal Fossa)
numba 0.55.0
numpy 1.21.5
Cython 0.29.28
(edit for formatting)
from k-means-constrained.
I've just tested on Ubuntu 20.04.3 with the above versions and it works fine for me. Did you change the numpy version after installing k-means-constrained
? Could you try uninstalling numpy
and k-means-constrained
, and then install numpy==1.21.5
and then k-means-constrained
from k-means-constrained.
I just uninstalled and re-installed numpy==1.21.5
and k-means-constrained
(0.7.0
) but it didn't change anything.
When running from k_means_constrained_ import KMeansConstrained
on a python instance I still get the same error specified above
from k-means-constrained.
If it helps the error is also raised by doing just import k_means_constrained
. See the full error message below
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import k_means_constrained
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/daniel/.local/lib/python3.8/site-packages/k_means_constrained/__init__.py", line 4, in <module>
from .k_means_constrained_ import KMeansConstrained
File "/home/daniel/.local/lib/python3.8/site-packages/k_means_constrained/k_means_constrained_.py", line 18, in <module>
from .sklearn_import.metrics.pairwise import euclidean_distances
File "/home/daniel/.local/lib/python3.8/site-packages/k_means_constrained/sklearn_import/metrics/pairwise.py", line 10, in <module>
from k_means_constrained.sklearn_import.metrics.pairwise_fast import _sparse_manhattan
File "k_means_constrained/sklearn_import/metrics/pairwise_fast.pyx", line 1, in init k_means_constrained.sklearn_import.metrics.pairwise_fast
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
from k-means-constrained.
It worked! Thanks.
As a note, it's worth mentioning that the pip install k-means-constrained
installed numpy-1.22.3
, which for the moment is incompatible with my numba 0.55.1
installation (which has the requirement numpy < 1.22
).
As long as numpy>=1.22.0
, then k-means-constrained
works (both in the venv
and outside), but other packages might not have updated their numpy
dependencies.
Thanks for fixing it @joshlk
from k-means-constrained.
Great. Closing this ticket. Others - please reopen if problem persists
from k-means-constrained.
Related Issues (20)
- Usage for size_max < sample size HOT 2
- Feature value constrained in a spatial aplication HOT 3
- [BUG] Won't install HOT 1
- [BUG] Incompatible with `ortools >= 9.4` (`No module named 'ortools.graph.pywrapgraph'`) HOT 9
- [BUG] installation issues with numpy < 1.23 HOT 3
- facing the issue during running HOT 2
- [BUG] Failed to build k-means-constrained HOT 3
- Wrong clustering HOT 1
- Wrong clustering with pre_computed adjacency matrix HOT 3
- QGIS implementation HOT 1
- ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject HOT 2
- [How to classify the new instances after obtaining a constrained clustering] HOT 1
- [BUG] error compiling on apple silicon. HOT 2
- Maybe tag a new release? HOT 1
- Issue in importing k-means-constrained in Google Colab notebook HOT 2
- Possibility to use this on k-modes HOT 2
- Can't install k-means-constrained HOT 2
- Resource intensity HOT 2
- Weighting observations HOT 1
- import k_means_constrained HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k-means-constrained.