Reputation: 33
I am trying to solve a MILP problem set up in PYOMO whith SCIP as solver. I run the problem from within PyDev using the python ANACONDA interpreter.
I can run and solve the problem with other solvers, namely CBC, GLPK, and IPOPT.
However, it does not work when using SCIP as solver. It seems like there is something wrong with the SCIP/AMPL interface... Anybody can help out?
Below are some details on the error prompt and system configuration.
I tried with 'scip' and 'scipampl'.
With 'scip'
opt = SolverFactory('scip')
instance = model.create_instance("test1.dat")
results = opt.solve(instance)
instance.display()
WARNING: "[base]/site-packages/pyomo/solvers/plugins/solvers/SCIPAMPL.py", 68, _default_executable Could not locate the 'scipampl' executable, which is required for solver scip Traceback (most recent call last): File "/home/alessandro/Documents/Eclipse workspace/test1/src/test1.py", line 48, in results = opt.solve(instance) # solves and updates instance File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 539, in solve self.available(exception_flag=True) File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/solver/shellcmd.py", line 122, in available raise ApplicationError(msg % self.name) pyutilib.common._exceptions.ApplicationError: No executable found for solver 'scip'
With 'scipampl'
opt = SolverFactory('scipampl')
instance = model.create_instance("test1.dat")
results = opt.solve(instance)
instance.display()
WARNING: "[base]/site-packages/pyomo/opt/base/solvers.py", 202, solver_call Failed to create solver with name 'scipampl': Failed to set executable for solver asl. File with name=scipampl either does not exist or it is not executable. To skip this validation, call set_executable with validate=False. Traceback (most recent call last): File "/home/alessandro/Documents/Eclipse workspace/test1/src/test1.py", line 48, in results = opt.solve(instance) File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 127, in solve self._solver_error('solve') File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 155, in _solver_error + "\n\toptions: %s" % ( self.options, ) ) RuntimeError: Attempting to use an unavailable solver.
The SolverFactory was unable to create the solver "scipampl" and returned an UnknownSolver object. This error is raised at the point where the UnknownSolver object was used as if it were valid (by calling method "solve").
The original solver was created with the following parameters: executable: scipampl type: scipampl _args: () options: {}
The Eclipse version is "Oxygen.1 (4.7.1)" and the PyDev version is "6.0.0".
The python, pyomo, and solvers versions are as follows:
~$ python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 30 2017, 18:42:57) [GCC 7.2.0] on linux
~$ pyomo --version
Pyomo 5.2 (CPython 3.6.2 on Linux 4.10.0-35-generic)
~$ cbc
Welcome to the CBC MILP Solver
Version: 2.9.9
Build Date: Jul 6 2017
~$ glpsol
GLPSOL: GLPK LP/MIP Solver, v4.63
~$ ipopt
No stub!
usage: ipopt [options] stub [-AMPL] [<assignment> ...]
~$ scip
SCIP version 4.0.1 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 3.0.1] [GitHash: 8a04b84]
Copyright (C) 2002-2017 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)
External codes:
SoPlex 3.0.1 Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash: 24cffa9]
CppAD 20160000.1 Algorithmic Differentiation of C++ algorithms developed by B. Bell (www.coin-or.org/CppAD)
ZLIB 1.2.8 General purpose compression library by J. Gailly and M. Adler (zlib.net)
GMP 6.1.0 GNU Multiple Precision Arithmetic Library developed by T. Granlund (gmplib.org)
ZIMPL 3.3.4 Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)
Ipopt 3.12.8 Interior Point Optimizer developed by A. Waechter et.al. (www.coin-or.org/Ipopt)
user parameter file <scip.set> not found - using default parameters
SCIP> ^C
I installed the CBC, GLPK and IPOT packages as follows:
conda install -c conda-forge coincbc
conda install -c conda-forge glpk
conda install -c conda-forge ipopt
I installed the latest SCIPOPTSUITE version "4.0.1" with the Linux-Debian package "SCIPOptSuite-4.0.1-Linux.deb"
I also installed AMPL-MP SCIPOPTLIB and PYSCIPOPT as follows:
conda install -c conda-forge ampl-mp
conda install -c leethargo scipoptlib
conda install -c leethargo pyscipopt
Upvotes: 3
Views: 6480
Reputation: 6706
EDIT: follow these instructions: http://zverovich.net/2012/08/07/using-scip-with-ampl.html
Several things that might help:
leethargo
is not the official conda package (because there is none)Ah, look what I found after googling "pyomo scip":
So, PYOMO only supports SCIP through the AMPL interface (ASL).
Upvotes: 3