5

I want to install pandas for use in Python

I have the latest release of xcode and command line tool, pip, easy_install, but installing this keeps giving me the following error, anyone can help?

sudo easy_install pandas

> Best match: pandas 0.13.1
>Downloading https://pypi.python.org/packages/source/p/pandas/pandas-0.13.1.zip#md5=50e4902238dd5312c20c1c85fb024bb6
>Processing pandas-0.13.1.zip
>Running pandas-0.13.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oU7Yfm/pandas-0.13.1/egg-dist-tmp-I4Mw_P
>warning: no files found matching 'README.rst'  no previously-included directories found matching 'doc/build'
>warning: no previously-included files matching '*.so' found anywhere in distribution
>warning: no previously-included files matching '*.pyd' found anywhere in distribution
>warning: no previously-included files matching '*.pyc' found anywhere in distribution
>warning: no previously-included files matching '.git*' found anywhere in distribution
>warning: no previously-included files matching '.DS_Store' found anywhere in distribution
>warning: no previously-included files matching '*.png' found anywhere in distribution
>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: Setup script exited with error: command 'cc' failed with exit status 1
kevin
  • 1,107
  • 1
  • 13
  • 17
  • install command line tools for XCode – Emin Mastizada Mar 15 '14 at 03:19
  • For installing something for python i suggest using pip install . For example: 'sudo pip install pandas' – Emin Mastizada Mar 15 '14 at 03:20
  • It's a problem caused by changes in Xcode 5.1 and Apple's choice of build options for the system Python. Duplicate of http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-psycopg2-installation-failure – Ned Deily Mar 15 '14 at 03:36
  • @EminMastizada Latest release of command line tools for XCode is installed. – kevin Mar 15 '14 at 03:45
  • @NedDeily unfortunately none of those solutions work for pandas. So I guess this question is still valid. Please do not close. Asking for more suggestions. – kevin Mar 15 '14 at 03:52
  • I seriously recommend using Anaconda, it avoids these type of painful build issues, also you then don't need to use sudo. – Andy Hayden Mar 15 '14 at 04:41

1 Answers1

9

As noted in the comments, this is a now common problem caused by changes in Xcode 5.1 and by Apple's choice of build options for the system Python 2.7. You can work around the issue by removing the offending options as suggested here. If you need to use sudo (which you might if you use the system-provided easy_install), you'll also need to ensure you define the variables in the sudo environment. One way to do it is:

sudo bash
umask 022
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
/usr/bin/easy_install pandas
exit

There are other options that would not require sudo like using a virtualenv or using pip install --user pandas.

UPDATE [2014-05-16]: As expected, Apple has fixed this problem with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 so the workaround is no longer necessary when using the latest Mavericks and Xcode 5.1+. However, as of now, the workaround is still required for OS X 10.8.x (Mountain Lion, currently 10.8.5) if you are using Xcode 5.1+ there.

Community
  • 1
  • 1
Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • Great. If you get an answer to a SO question you pose, please either mark it as accepted or edit the question until you do get one you can accept. That way, both you and the answerer are credited and it saves other people time when looking for questions to answer. – Ned Deily Mar 15 '14 at 07:09