【问题标题】:Error Install Pandas for Python on Mac OS X在 Mac OS X 上安装 Pandas for Python 时出错
【发布时间】:2014-03-15 03:12:52
【问题描述】:

我想安装 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 安装命令行工具
  • 要为 python 安装一些东西,我建议使用 pip install 。例如:'sudo pip install pandas'
  • 这是由于 Xcode 5.1 的更改和 Apple 对系统 Python 的构建选项的选择导致的问题。与stackoverflow.com/questions/22313407/… 重复
  • @EminMastizada 已安装最新版本的 XCode 命令行工具。
  • @NedDeily 不幸的是,这些解决方案都不适用于 pandas。所以我想这个问题仍然有效。请不要关闭。寻求更多建议。

标签: python xcode pandas command pip


【解决方案1】:

正如 cmets 中所述,这是由于 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)修复了此问题,因此在使用最新的 Mavericks 和 @ 987654330@。但是,到目前为止,如果您在那里使用Xcode 5.1+OS X 10.8.x(Mountain Lion,当前为 10.8.5)仍然需要解决方法。

【讨论】:

  • 太棒了。如果您对提出的 SO 问题得到答案,请将其标记为已接受或编辑问题,直到您得到可以接受的问题。这样一来,您和回答者都会得到认可,并且可以节省其他人寻找要回答的问题的时间。
猜你喜欢
  • 2015-12-10
  • 2011-05-16
  • 2015-12-06
  • 1970-01-01
  • 2015-08-19
  • 2015-03-19
  • 2012-01-09
  • 2018-03-30
  • 2016-02-27
相关资源
最近更新 更多