错误在Mac OS X上安装Python的Pandas

我想安装pandas以便在Python中使用

我有最新版本的xcode和命令行工具,pip,easy_install,但安装这个一直给我以下错误,任何人都可以帮忙吗?

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
最佳答案
正如评论中所指出的,这是一个现在常见的问题,这是由Xcode 5.1的变化和Apple为系统Python 2.7选择的构建选项引起的.您可以通过删除违规选项来解决此问题,如建议here.如果您需要使用sudo(如果您使用系统提供的easy_install,则可能使用sudo),您还需要确保在sudo环境中定义变量.一种方法是:

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

还有其他选项不需要sudo,比如使用virtualenv或使用pip install –user pandas.

更新[2014-05-16]:正如预期的那样,Apple已经使用OS X 10.9.3中更新的系统Pythons(2.7,2.6和2.5)解决了这个问题,因此在使用最新的Mavericks和Xcode 5.1时不再需要解决方法.但是,截至目前,如果您在那里使用Xcode 5.1,OS X 10.8.x(Mountain Lion,目前为10.8.5)仍然需要解决方法.

转载注明原文:错误在Mac OS X上安装Python的Pandas - 代码日志