Where does `pip` install libraries compared to where `python` from terminal runs?
<p>I'm trying to install <code>python's scikit learn</code> for some machine learning, and it appears to do it successfully (i.e. it is already installed).  However, when I try to actually use it in <code>python</code> in the terminal, it gives me an error, as shown below.  </p>

<pre><code>23:39 $ sudo pip install sklearn
The directory '/Users/username/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/username/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting sklearn
Requirement already satisfied (use --upgrade to upgrade): scikit-learn in /Library/Python/2.7/site-packages (from sklearn)
Installing collected packages: sklearn
Successfully installed sklearn-0.0
â /usr/bin 
23:42 $ python
Python 2.7.12rc1 (v2.7.12rc1:13912cd1e7e8, Jun 11 2016, 15:32:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import sklearn
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in &lt;module&gt;
    from .base import clone
  File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in &lt;module&gt;
    from .utils.fixes import signature
  File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 11, in &lt;module&gt;
    from .validation import (as_float_array,
  File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line 16, in &lt;module&gt;
    from ..utils.fixes import signature
  File "/Library/Python/2.7/site-packages/sklearn/utils/fixes.py", line 324, in &lt;module&gt;
    from scipy.sparse.linalg import lsqr as sparse_lsqr
  File "/usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/__init__.py", line 112, in &lt;module&gt;
    from .isolve import *
  File "/usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/__init__.py", line 6, in &lt;module&gt;
    from .iterative import *
  File "/usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/iterative.py", line 7, in &lt;module&gt;
    from . import _iterative
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/_iterative.so, 2): Symbol not found: ___addtf3
  Referenced from: /usr/local/opt/gcc/lib/gcc/6/libquadmath.0.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/opt/gcc/lib/gcc/6/libquadmath.0.dylib
&gt;&gt;&gt; exit()
â /usr/bin 
23:43 $ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
</code></pre>

<p>I think that there must be some difference between where the packages   are installed by <code>pip install &lt;package name&gt;</code> and where they are actually accessed when I call <code>python</code> in the terminal.  </p>

<p>What is the difference between:</p>

<p>1)  where packages are installed via <code>pip install &lt;package name&gt;</code>?  </p>

<p>AND</p>

<p>2)  where the packages are searched for when calling <code>python</code> from the terminal?  </p>

<p>I put the results of <code>which python</code> at the bottom because I think that might be useful.
Also, guys I'm using Mac OS El Capitan version 10.11.4. </p>

<p>This problem doesn't have anything to do with python package paths. It is due to the unresolved symbol <code>___addtf3</code> which is a GCC software floating point routine provided by a <code>gfortran</code> library. A <a href="https://github.com/JuliaLang/julia/issues/636" rel="nofollow">similar issue with a different application</a> (completely unrelated to python) was solved by properly setting the <code>DYLD_LIBRARY_PATH</code> environment variable. Of course you must have those libraries installed on your system, which may be the real problem in your case.</p>

python python-2.7 terminal scikit-learn