Search code examples
xcodepandasinstallationpipcc

Pandas Install Error on Mac


When I execute

sudo pip install pandas

I get the error:

creating build/temp.macosx-10.9-intel-2.7/pandas/src/datetime

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Ipandas/src/klib -Ipandas/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.9-intel-2.7/pandas/index.o

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

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

I have installed xcode and xcode command line tools.

In fact, I can confirm that cc is installed by executing:

cc -v

which returns:

Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

Solution

  • These flags ended up letting me install it:

    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments
    

    and then (of course):

    sudo -E pip install pandas
    

    Thanks @user3378649 for the flags suggestion - that got me thinking along the right track!