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

1

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.

Caspar answered 26/11, 2019 at 15:45 Comment(1)
FYI: to get support with Academic Initiative licenses and CP Optimizer you can use the official IBM forum here. However, it is fine to ask questions here too.Mohawk
M
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.

Mohawk answered 26/11, 2019 at 19:27 Comment(1)
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'\nCaspar

© 2022 - 2024 — McMap. All rights reserved.