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

Highs not working #394

Closed
andreaswiese opened this issue Oct 27, 2024 · 2 comments
Closed

Highs not working #394

andreaswiese opened this issue Oct 27, 2024 · 2 comments

Comments

@andreaswiese
Copy link

Describe the bug

When I try to use the solver HiGHS in Python-MIP, I get the error message

FileNotFoundError: HiGHS not found.Please install the highspy package, orset the PMIP_HIGHS_LIBRARY environment variable.

To Reproduce

Small example:

from mip import *

p = [10, 13, 18, 31, 7, 15]
w = [11, 15, 20, 35, 10, 33]
c, I = 47, range(len(w))

m = Model("knapsack", sense=MAXIMIZE, solver_name="highs")

x = [m.add_var(var_type=BINARY) for i in I]

m.objective = maximize(xsum(p[i] * x[i] for i in I))

m += xsum(w[i] * x[i] for i in I) <= c

m.optimize()

Expected behavior
Python-MIP solves the MIP

Desktop (please complete the following information):

  • Operating System, version: Ubuntu 24.04.1 LTS
  • Python version: 3.12
  • Python-MIP version (we recommend you to test with the latest version): 1.6.0rc0

Workaround
I noticed that model.py executes the command

import mip.highs

Then, highs.py searches for a HiGHS library with the pattern

pattern = "highs_bindings.*.so"

In my folder /lib/python3.12/site-packages/highspy there is no library following this pattern and I believe that this causes this error. However, there is a library called "_core.cpython-312-x86_64-linux-gnu.so" and I believe that this is the library that highs.py is looking for. Therefore, I created a copy of this library called "highs_bindings._core.cpython-312-x86_64-linux-gnu.so" and then Python-MIP correctly solves the MIP with HiGHS.

Maybe highs.py just needs to search for a different file pattern when it searches for the HiGHS library.

@rschwarz
Copy link
Contributor

This is maybe related (and/or fixed) by #377.

@andreaswiese
Copy link
Author

I agree that this is the same problem. I believe that the fix for #377 solves this problem as well. It seems that I simply need to use the latest version in the repository instead of 1.6.0rc0. Thank you!

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

2 participants