Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incompatible with ortools >= 9.4 (No module named 'ortools.graph.pywrapgraph') #28

Closed
esmail opened this issue Aug 15, 2022 · 9 comments

Comments

@esmail
Copy link
Contributor

esmail commented Aug 15, 2022

Describe the bug
k-means-constrained is incompatible with ortools version 9.4+

Minimum working example
from k_means_constrained import KMeansConstrained

Results in:

...
    from k_means_constrained import KMeansConstrained
  File "/home/ubuntu/hbx/python/lib/python3.8/site-packages/k_means_constrained/__init__.py", line 4, in <module>
    from .k_means_constrained_ import KMeansConstrained
  File "/home/ubuntu/hbx/python/lib/python3.8/site-packages/k_means_constrained/k_means_constrained_.py", line 29, in <module>
    from k_means_constrained.mincostflow_vectorized import SimpleMinCostFlowVectorized
  File "/home/ubuntu/hbx/python/lib/python3.8/site-packages/k_means_constrained/mincostflow_vectorized.py", line 4, in <module>
    from ortools.graph.pywrapgraph import SimpleMinCostFlow
ModuleNotFoundError: No module named 'ortools.graph.pywrapgraph'

Versions:

  • Python: Python 3.8.10
  • Operating system: Linux
  • k-means-constrained: k-means-constrained==0.5.1
  • numpy: numpy==1.23.1
  • scipy: scipy==1.8.1
  • ortools: ortools==9.4.1874
  • joblib: joblib==1.1.0
  • cython (if installed):
@esmail esmail changed the title [BUG] Incompatible with ortools >= 9.4 [BUG] Incompatible with ortools >= 9.4 (No module named 'ortools.graph.pywrapgraph') Aug 15, 2022
@esmail esmail mentioned this issue Aug 15, 2022
@lperron
Copy link

lperron commented Aug 19, 2022

Please replace ortools.graph.pywrapgraph by ortools.graph.python.min_cost_flow.

@lperron
Copy link

lperron commented Aug 19, 2022

The good news is that it now supports numpy to speed-up the creation of the graph.

See this example.

@datatravelgit
Copy link

Please replace ortools.graph.pywrapgraph by ortools.graph.python.min_cost_flow.

As far as I my test goes, this is not sufficient. Other imports may need to be changed to adapt to or tools >=9.4

@lperron
Copy link

lperron commented Aug 29, 2022 via email

@joshlk
Copy link
Owner

joshlk commented Sep 5, 2022

The issue should be resolved with the latest version. Please update the package using pip install 'k-means-constrained>=0.7.2' and report back

@lcustodio
Copy link

New version is working fine for me 👍

@joshlk
Copy link
Owner

joshlk commented Sep 6, 2022

Great. I’ll close this for now. Let me know if you have any more issues

@joshlk joshlk closed this as completed Sep 6, 2022
@datatravelgit
Copy link

Just tested. All ok on my side as well. Thanks

@lperron
Copy link

lperron commented Sep 9, 2022

Thanks for the rapid fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants