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

问题描述 投票:5回答:1

我想安装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
python xcode pandas command pip
1个回答
9
投票

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

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

还有其他选择不需要使用sudo或使用virtualenv

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

© www.soinside.com 2019 - 2024. All rights reserved.