python - 在 Mac OS X 上安装 Pandas for Python 时出错

标签 python xcode pandas command pip

我想安装 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 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 中更新的系统 Python(2.7、2.6 和 2.5)解决了这个问题,因此解决方法是 no使用最新的 Mavericks 和 Xcode 5.1+ 时不再需要。但是,到目前为止,如果您在那里使用 Xcode 5.1+OS X 10.8.x(Mountain Lion,当前为 10.8.5)仍然需要解决方法。

关于python - 在 Mac OS X 上安装 Pandas for Python 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22419071/

相关文章:

python - 一起使用堆排序和快速排序

python - PyQt4 中的 CSS 显示错误

python - 如何使用 Python 使用 Selenium 选择下拉菜单值?

ios - UICollectionView 将单元​​格存储在数组中以便快速加载

ios - 如何在 iPhone 应用中实现语言翻译?

python - Pandas:使用一个公共(public)列合并多个 DataFrame

python - 根据元组中的值从列表中删除重复的元组

ios - 使用 UIBezierPath 在 Swift 3.x 中画一条线

python - Pandas 数据框到字典

python - "Merging"具有共同维度的 numpy 数组