How to use appsi_highs solver in Pyomo with pyenv and poetry

360 views Asked by At

I have troubles making the appsi_highs solver work in Pyomo inside a Poetry virtual env using a pyenv python 3.10.

I used the command inside my virtual env:

pyomo build-extensions

Which seems to be correctly installed :

Install the project...
-- Install configuration: ""
-- Installing: /myuser/.pyomo/lib/libpynumero_ASL.so
-- Installing: /myuser/.pyomo/bin/tests/pynumero_asl_test
-- Set runtime path of "/myuser/.pyomo/bin/tests/pynumero_asl_test" to ""
-- Installing: /myuser/.pyomo/bin/tests/simple_nlp.nl
Installed PyNumero libraries to /myuser/.pyomo
INFO: Finished building Pyomo extensions.
INFO: The following extensions were built:
    [ OK ]  ampl_function_demo
    [ OK ]  appsi
    [ OK ]  mcpp
    [ OK ]  pynumero

I keep getting the error :

 pyomo.common.errors.ApplicationError: Solver <class 'pyomo.contrib.appsi.base.SolverFactoryClass.register.<locals>.decorator.<locals>.LegacySolver'> is not available (NotFound).

It seems that the build-extensions command installs things in /myuser/.pyomo whereas my virtual env is in /myuser/myprojet/.venv/bin/python

I managed to make it work inside a docker using the root python.

Update:

  • I m on OS X (intel)
  • Just tried pip install highspy==1.1.2.dev3 and it worked.

Thank you !

0

There are 0 answers