I'm trying to switch from Homebrew Python to Anaconda Python.
My $PATH is:
234:~ user$ echo $PATH
/Users/user/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
Also, when I check which python
, which pip
, and which conda
I get the anaconda directory for all three. But I still get the following when I try to import some standard package (which is installed in the anaconda directory):
234:~ user$ python
Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
'>>> import numpy
Traceback (most recent call last):
File "<'stdin>", line 1, in
File "/usr/local/lib/python2.7/site-packages/numpy/init.py", line 142, in <'module> ...
ImportError:
Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try git clean -xdf
(removes all files not under version control). Otherwise reinstall numpy.
I have tried a reboot and completely uninstalling anaconda and reinstalling, all to no avail. Why is python still using my usr/local/lib
directory to hunt for packages? How do I redirect it to the anaconda directory?