<p dir="auto">There appears to ba a bug in scipy.optimize.fmin_slsqp; given a set of unsatisfyable constraints, the imode return parameter should signal this with a return value of 4, but this does not appear to happen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import scipy.optimize
normals = np.concatenate([np.eye(2), -np.eye(2)])
depth = 1
f_ieqcons = lambda x: normals.dot(x) - depth
x, fx, its, imode, smode = scipy.optimize.fmin_slsqp(
    func=lambda x: (x**2).sum(),
    x0=np.zeros(2),
    f_ieqcons=f_ieqcons,
    full_output=True
)
print(f_ieqcons(x))
assert imode==4  # fail"><pre class="notranslate"><code class="notranslate">import scipy.optimize
normals = np.concatenate([np.eye(2), -np.eye(2)])
depth = 1
f_ieqcons = lambda x: normals.dot(x) - depth
x, fx, its, imode, smode = scipy.optimize.fmin_slsqp(
    func=lambda x: (x**2).sum(),
    x0=np.zeros(2),
    f_ieqcons=f_ieqcons,
    full_output=True
)
print(f_ieqcons(x))
assert imode==4  # fail
</code></pre></div>
<p dir="auto">that is, given anaconda scipy 0.17.1 np110py35_1</p>
<p dir="auto">From mailing list:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="x = [1,2]
optimize.minimize(
    lambda x: x[0]**2+x[1]**2, x,
    constraints = (
        {'type':'eq','fun': lambda x: x[0]+x[1]-1},
        {'type':'ineq','fun': lambda x: x[0]-2}
                  ),
    bounds = ((0,None),(0,None)),
    method='SLSQP')"><pre class="notranslate"><code class="notranslate">x = [1,2]
optimize.minimize(
    lambda x: x[0]**2+x[1]**2, x,
    constraints = (
        {'type':'eq','fun': lambda x: x[0]+x[1]-1},
        {'type':'ineq','fun': lambda x: x[0]-2}
                  ),
    bounds = ((0,None),(0,None)),
    method='SLSQP')
</code></pre></div>
<p dir="auto">returns (0.18.0.dev0+1eeef28)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="     fun: 2.77777777777712
     jac: array([  3.33333334e+00,   2.98023224e-08,   0.00000000e+00])
 message: 'Optimization terminated successfully.'
    nfev: 8
     nit: 6
    njev: 2
  status: 0
 success: True
       x: array([  1.66666667e+00,   1.39888101e-14])"><pre class="notranslate"><code class="notranslate">     fun: 2.77777777777712
     jac: array([  3.33333334e+00,   2.98023224e-08,   0.00000000e+00])
 message: 'Optimization terminated successfully.'
    nfev: 8
     nit: 6
    njev: 2
  status: 0
 success: True
       x: array([  1.66666667e+00,   1.39888101e-14])
</code></pre></div>