title: Pyomo scip solver Error FileNotFoundError
body: <p>I am trying to use <a href="https://scipopt.org/index.php#download" rel="nofollow noreferrer">scip</a> solver in <a href="https://pyomo.readthedocs.io/en/stable/" rel="nofollow noreferrer">pyomo</a> on ubuntu 20.04 but get a strange error message when invoking the solver:</p>
  <blockquote>
  <p>FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpxsrkdky5.pyomo.sol'</p>
  </blockquote>
  <p><code>pyomo</code> was installed via <code>pip</code> and <code>scip</code> was installed via the installer script on their  <a href="https://scipopt.org/index.php#download" rel="nofollow noreferrer">download page</a>. I was unable to install the <code>.deb</code> file because of dependency issues -- being on Ubuntu 20.04 instead of 18.04. The installer script installed <code>scip</code> in a folder in my home directory, but I do provide the path to the solver in my python script.</p>
  <p>Minimal Working Example:</p>
  <pre><code>import pyomo.environ as pyo
  
  # basic setup
  Agents = list(range(10))
  Values = [1, 3, 5, 3, 2, 4, 5, 6, 4, 1]
  Weight = [1, 2, 3, 4, 5, 6, 4, 2, 3, 1]
  
  # create pyo model and set variable
  Dummy = pyo.ConcreteModel()
  Dummy.x = pyo.Var(Agents, bounds=(0, 1))
  
  # set objective
  Dummy.obj = pyo.Objective(expr=(sum(Dummy.x[i]*Values[i] for i in Agents)))
  
  # add a constraint
  Dummy.constraint = pyo.ConstraintList()
  Dummy.constraint.add(sum(Dummy.x[i]*Weight[i] for i in Agents) &lt;= 10)
  
  # select solver and solve problem
  opt = pyo.SolverFactory('scip', executable='/path/to/solver/SCIPOptSuite-7.0.1-Linux/bin/scip')
  opt.solve(Dummy)
  </code></pre>
  <p>Edit:
  I was not able to solve the pyomo model with scip. However, I was able to directly model and solve the problem using <a href="https://github.com/SCIP-Interfaces/PySCIPOpt" rel="nofollow noreferrer">PySCIPOpt</a>. The <a href="http://scip-interfaces.github.io/PySCIPOpt/docs/html/bpp_8py_source.html" rel="nofollow noreferrer">Examples</a> in their documentation helped quite a bit.</p>
  <pre><code>from pyscipopt import Model, quicksum
  
  # basic setup
  Agents = list(range(10))
  Values = [1, 3, 5, 3, 2, 4, 5, 6, 4, 1]
  Weight = [1, 2, 3, 4, 5, 6, 4, 2, 3, 1]
  
  #==================solve it straight with scip================================
  Dummy = Model(&quot;dummy&quot;)
  # vtype='C' means the variable is continuous
  x = [Dummy.addVar(lb = 0, ub=1, name=(&quot;x&quot; + str(i)), vtype='C') for i in Agents]
  
  # set objective
  Dummy.setObjective(quicksum(x[i]*Values[i] for i in Agents), sense=&quot;maximize&quot;)
  
  # add a constraint
  Dummy.addCons(quicksum(x[i]*Weight[i] for i in Agents) &lt;= 10)
  
  # solve problem
  Dummy.optimize()
  sol = Dummy.getBestSol()
  print(sol)
  </code></pre>
  <p>EditEdit:
  Yesterday it still worked, but trying to run it again today, it returns a trivial solution and not the optimal solution.</p>