How do I install scipy & its optimization module (using Python 2.7.10)
<p>I've run the following optimization example code (and alternatives) and it keeps giving me the following error(s) -- </p>

<blockquote>
  <p>"Input Error: cannot import optimize" OR "No module named optimize"</p>
</blockquote>

<pre><code>import numpy as np

from scipy import optimize

from scipy.optimize import fmin_slsqp

def f(x): return np.sqrt((x[0] - 3)**2 + (x[1] - 2)**2)

def constraint(x):
        return np.atleast_1d(1.5 - np.sum(np.abs(x)))

scipy.optimize.fmin_slsqp(f, np.array([0,0]), ieqcons = [constraint,])
</code></pre>

<p>I've also tried to update Scipy and Optimize with the pip command.  Scipy is updated and I get the following when trying to update Optimize: </p>

<p>"Could not find a version that satisfies the requirement optimize (from versions: )
No matching distribution found for optimize"</p>

<p>Thanks in advance</p>

<p>Can you upgrade <code>scipy</code> to version 0.17?  I can't reproduce the error with version 0.17:</p>

<p><code>pip install scipy==0.17.0</code></p>

python numpy optimization scipy