Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install numpy on Mountain Lion

Tags:

python

numpy

nltk

I'm completely new to Python, I'm trying to install NLTK based on http://nltk.org/install.html

I've got everything installed except for numpy (it says numpy is optional but when I try to import nltk, it says there's an error because it couldn't find the numpy module)

after I run sudo pip install -U numpy

I'm running on a Mac with Mountain Lion, python v2.7.3

I get the following error (I only included the end of log):

File "/private/tmp/pip-build/numpy/numpy/core/setup.py", line 696, in get_mathlib_info

raise RuntimeError("Broken toolchain: cannot link a simple C program")

RuntimeError: Broken toolchain: cannot link a simple C program


Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/numpy

Has anyone seen this happen?

like image 640
Art Avatar asked Oct 26 '12 18:10

Art


2 Answers

If you open a command prompt and type gcc does it run without error? If not, you may need to install XCode (available on the appstore) and then the command line tools (it looks similar to this post) so that you can complete the install for numpy.

like image 111
AlG Avatar answered Nov 12 '22 07:11

AlG


Recently I had been seeing this along with:

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

See here to fix:

clang error: unknown argument: '-mno-fused-madd' (python package installation failure)

like image 2
Jesse Smith Avatar answered Nov 12 '22 06:11

Jesse Smith