Giter Site home page Giter Site logo

Comments (15)

joshlk avatar joshlk commented on June 1, 2024 1

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.

joshlk avatar joshlk commented on June 1, 2024 1

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

Warren-S5 avatar Warren-S5 commented on June 1, 2024

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.

danvip10 avatar danvip10 commented on June 1, 2024

Hi, I'm also getting this same error. Has anyone found a solution?

Running Python 3.8.10.

from k-means-constrained.

danvip10 avatar danvip10 commented on June 1, 2024

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.

joshlk avatar joshlk commented on June 1, 2024

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.

joshlk avatar joshlk commented on June 1, 2024

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.

danvip10 avatar danvip10 commented on June 1, 2024

sorry that was a typo, I meant numpy 1.21.5

from k-means-constrained.

joshlk avatar joshlk commented on June 1, 2024

Ok can you please provide me with the following versions:

  • Python:
  • Operating system: [Windows/MacOS/Linux]
  • numpy:
  • cython (if installed):

from k-means-constrained.

danvip10 avatar danvip10 commented on June 1, 2024
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.

joshlk avatar joshlk commented on June 1, 2024

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.

danvip10 avatar danvip10 commented on June 1, 2024

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.

danvip10 avatar danvip10 commented on June 1, 2024

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.

danvip10 avatar danvip10 commented on June 1, 2024

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.

joshlk avatar joshlk commented on June 1, 2024

Great. Closing this ticket. Others - please reopen if problem persists

from k-means-constrained.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.