Open SolverMax opened 1 year ago
How did you install HiGHS? Did you install the python bindings as well? It does not look like highspy 1.5.1 is on PyPI yet, so we are not testing against it yet. I did install the latest version of HiGHS locally, and everything seems to be working.
HiGHS was originally installed using: pip install highspy It was recently upgraded using: pip install highspy --upgrade Testing the solvers using: pyomo help --solvers used to indicate appsi_highs was available by marking it with a + but it no longer does. The HiGHS version says 1.5.0.dev0 I'm not sure why I thought it was 1.5.1
Can you try:
>>> import highspy
in a python console?
After downgrading to 1.4.0dev I get this: import highspy highspy <module 'highspy' from 'D:\OneDrive\Python\blog\lib\site-packages\highspy\init.py'>
After reinstalling 1.5.0dev I get this:
import highspy
Traceback (most recent call last):
File "
If you look in the highspy directory in your python site-packages, do you see any dll files?
No DLLs
Sounds like the DLL is not getting copied from the wheel into your site-packages. I'll create an issue on the HiGHS repo. In the meantime, you can probably manually download the correct wheel from here (https://pypi.org/project/highspy/#files), unzip the wheel, and put the DLL in your site packages.
Sorry - can you check one more thing? Are there any ".pyd" files in your site-packages?
I think you need the ".pyd" rather than the DLL. I'm not sure though.
I have .\Lib\site-packages\highspy\highs_bindings.cp39-win_amd64.pyd Looking around I also have .\Lib\site-packages\highspy.libs\msvcp140.dll
These appear to be the same filenames that v1.4.0dev has.
Strange...
It looks like there is also a highs-*.dll in the wheel under highspy.libs. Do you see anything like that?
Yes, that's there too, along with .load-order-highspy-1.5.0.dev0
Then I am stumped.
When I downgrade to 1.4.0dev my test model solves OK, but not with 1.5.0dev. I'll continuing using 1.4.0dev in the meantime.
Summary
Calling the solver appsi_highs produces the error message: ApplicationError: Solver <class 'pyomo.contrib.appsi.base.SolverFactoryClass.register..decorator..LegacySolver'> is not available (NotFound).
Steps to reproduce the issue
Sample model at: https://github.com/SolverMax/Random/tree/main/HiGHS-testing/Case-001
The sample model runs correctly when called using the cbc solver (specified in the data file), but fails when using appsi_highs. A few weeks ago it ran correctly with appsi_highs, but Pyomo and HiGHS versions have been upgraded since then.
Information on your system
Pyomo version: Pyomo 6.5.0 (CPython 3.9.7 on Windows 10) Python version: 3.9.7 How Pyomo was installed (PyPI, conda, source): PyPI Solver (if applicable): HiGHs v1.5.1