5

I have CPLEX Optimization Studio installed on my Ubuntu machine and I am using the docplex model module with success. Now I have to use CpoModel from docplex.cp.model and I have the error:

CpoException: Can not execute command 'cpoptimizer -angel'. Please check availability of required executable file.

I have no idea what's going on. I cannot get support from IBM because I have student license.

rkersh
  • 4,447
  • 2
  • 22
  • 31
raisedbywolves
  • 111
  • 2
  • 6
  • FYI: to get support with Academic Initiative licenses and CP Optimizer you can use the official IBM forum [here](https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002066). However, it is fine to ask questions here too. – rkersh Nov 26 '19 at 19:32

1 Answers1

6

Please try the following as suggested here:

CpoModel.solve(agent='local',
               execfile='COSHOME/cpoptimizer/bin/cpoptimizer')

Where COSHOME is the directory where CPLEX Optimization Studio is installed.

Alternately, you can create a file named cpo_config.py that looks like the following and include it in your PYTHONPATH:

context.solver.agent = 'local'
context.solver.local.execfile = 'full path of the cpoptimizer executable'

The advantage of the later is that it would apply to all of your docplex programs. See also the documentation on configuring the local solving agent.

rkersh
  • 4,447
  • 2
  • 22
  • 31
  • 3
    Thanks. I've also just got this working with `from docplex.cp.config import context\n, context.solver.agent = 'local'\n, context.solver.local.execfile = '/opt/ibm/ILOG/CPLEX_Studio129/cpoptimizer/bin/x86-64_linux/cpoptimizer'\n` – raisedbywolves Nov 27 '19 at 19:37