Coincbc solver instead of Gurobi

Alternatively, it would be OK to install the coincbc solver but I don’t know how to install it in my environment with virtualenv

On my local machine i use conda
conda install -c conda-forge coincbc

But virtualenv requires pip which is not available for coincbc

Would it be possible otherwise to install coincbc as a module?
This is opensource software.

HI there,

I do not understand what is not available in Conda, since the following works as expected (cf. cbcpy · PyPI and python - How to install `coincbc` using Conda in Windows - Stack Overflow , and hpc:applications_and_libraries [eResearch Doc] ):

capello@login2:~$ module purge
capello@login2:~$ module load GCCcore/8.3.0
capello@login2:~$ module load Python/3.7.4
capello@login2:~$ mkdir test-coincbc-sasse
capello@login2:~$ virtualenv --no-site-packages ~/test-coincbc-sasse/
Using base prefix '/opt/ebsofts/Python/3.7.4-GCCcore-8.3.0'
New python executable in /home/users/c/capello/test-coincbc-sasse/bin/python
Installing setuptools, pip, wheel...
capello@login2:~$ . ~/test-coincbc-sasse/bin/activate
(test-coincbc-sasse) capello@login2:~$ pip install cbcpy
Collecting cbcpy
  Downloading cbcpy-2.10.3a2-cp37-cp37m-manylinux2010_x86_64.whl (4.5 MB)
     |████████████████████████████████| 4.5 MB 6.1 MB/s
Installing collected packages: cbcpy
Successfully installed cbcpy-2.10.3a2
(test-coincbc-sasse) capello@login2:~$ python
Python 3.7.4 (default, Nov  7 2019, 17:45:19)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cbcpy
>>> quit()
(test-coincbc-sasse) capello@login2:~$ deactivate

Only version 2.10.3 for foss/2018b (thus GCC/7.3.0 thus Python/3.6.6 , cf. hpc:applications_and_libraries [eResearch Doc] ) is available (cf. Redirecting... ).

Would that be OK for you? IMHO it is still preferable to use the virtualenv/pip cbcpy version above.

Thx, bye,

Hi Luca,

I installed with pip as you did.
But the pyomo optimization framework that I use cannot find the solver.
It does however find the Gurobi solver.

I check which solvers are installed with this command

~/baobab_python_env/bin/pyomo help --solvers

From this I get the following output in the Terminal about the found solvers (+ indicates that it is installed, and without a plus indicates that it is not installed):

cbc The CBC LP/MIP solver
+gurobi 8.1.1 The GUROBI LP/MIP solver
The leading symbol (one of *, -, +) indicates the current solver
availability. A plus (+) indicates the solver is currently available
to be run from Pyomo with the serial solver manager, and (if
applicable) has a valid license.

If I run the code with CBC solver and after I installed with PIP, the model crashes because Pyomo cannot find the solver as indicated above.

Error with “cbc” as solver name:

pyutilib.common._exceptions.ApplicationError: No executable found for solver ‘cbc’

Error with cbcpy as solver name:

RuntimeError: Attempting to use an unavailable solver.

The suggested method is to install with conda, as indicated here Installation — PyPSA: Python for Power System Analysis

conda install -c conda-forge coincbc