python - ImportError: No module named scipy on Mac
<p>It's been so hard to find solution for this problem.</p>

<p>I've been reading on the internet and found this questions on Stackoverflow:</p>

<p><a href="http://stackoverflow.com/questions/29223187/importerror-no-module-named-scipy-after-installing-the-scipy-package">Solution #1</a> and <a href="http://stackoverflow.com/questions/24808043/importerror-no-module-named-scipy">Solution #2</a> with no results.</p>

<p>When I use:</p>

<pre><code>pip install scipy
</code></pre>

<p>It outputs</p>

<pre><code>Requirement already satisfied (use --upgrade to upgrade): scipy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
</code></pre>

<p>Then I do</p>

<pre><code>pip install scipy --updrage
</code></pre>

<p>And it outputs</p>

<pre><code>OSError: [Errno 1] Operation not permitted: 
'/var/folders/y3/r_j97_g91494mm7r9th0zycm0000gn/T/pip-paR57c-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
</code></pre>

<p>I even try to install using <code>port</code>:</p>

<pre><code>sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
</code></pre>

<p>Same result, it says it's been installed but when I try to run my Python project, prints the same error.</p>

<p>Hope you guys can help me.</p>

<p>I believe that your issue may be how you are running your code - OS-X can have <strong>both</strong> the system python and a user python installation.</p>

<p>From the command prompt, (the same one that pip tells you that you already have scipy installed), try running your script, <em>which I will assume is called <code>your_script.py</code></em> with:</p>

<pre><code>python your_script.py
</code></pre>

<p>And it should work, however if you run:</p>

<pre><code>your_script.py
</code></pre>

<p>it may not work.</p>

<p>I don't have a Mac to experiment on but you should do some reading on this issue online - <a href="https://docs.python.org/3/using/mac.html" rel="nofollow">here</a> </p>

python pip homebrew