在Mac OSX上安装Pandas

2024-03-28 10:37:20 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的Mac OSX计算机上安装Python Pandas库时遇到问题。

我在终端中键入以下内容:

$ sudo easy_install pandas

但我得到了以下信息:

Searching for pandas
Reading http://pypi.python.org/simple/pandas/
Reading http://pandas.pydata.org
Reading http://pandas.sourceforge.net
Best match: pandas 0.9.0
Downloading http://pypi.python.org/packages/source/p/pandas/pandas-
0.9.0.zip#md5=04b1d8e11cc0fc30ae777499d89003ec
Processing pandas-0.9.0.zip
Writing /tmp/easy_install-ixjbQO/pandas-0.9.0/setup.cfg
Running pandas-0.9.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ixjbQO/pandas-
0.9.0/egg-dist-tmp-EGREoT
warning: no files found matching 'setupegg.py'
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
unable to execute gcc: No such file or directory
error: Setup script exited with error: command 'gcc' failed with exit status 1

我确实安装了Xcode和gcc,但是,gcc只在我键入:

$ gcc
-bash: gcc: command not found

$ gcc-4.2
i686-apple-darwin11-gcc-4.2.1: no input files

我该怎么办?


Tags: installnoinhttppandaseasyfilesdistribution
3条回答

安装pip

然后用pip安装pandas

pip install pandas

可以在自制程序中安装python:

brew install python

确保OSX使用正确的路径:

which python

然后可以使用pip工具安装panda:

pip install pandas

确保安装了所有依赖项。我学习了本教程:http://penandpants.com/2013/04/04/install-scientific-python-on-mac-os-x/

在我的机器上运行良好。

您需要安装XCode,并且需要确保安装XCode的命令行工具,以便获得gcc。

相关问题 更多 >