【发布时间】:2012-09-08 08:30:01
【问题描述】:
我想在 Mac OS X 10.6.8 上安装 Python Pandas 库 (0.8.1)。这个库需要 Numpy>=1.6。
我试过了
$ 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.8.1
Downloading http://pypi.python.org/packages/source/p/pandas/pandas-0.8.1.zip#md5=d2c5c5bea971cd760b0ae6f6850fcb74
Processing pandas-0.8.1.zip
Running pandas-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ckAMym/pandas-0.8.1/egg-dist-tmp-0mlL7t
error: Setup script exited with pandas requires NumPy >= 1.6 due to datetime64 dependency
所以我尝试安装 Numpy
$ sudo easy_install numpy
Searching for numpy
Best match: numpy 1.6.2
Adding numpy 1.6.2 to easy-install.pth file
Using /Library/Python/2.6/site-packages
Processing dependencies for numpy
Finished processing dependencies for numpy
所以我又试了一次
$ sudo easy_install pandas
但问题还是一样!
error: Setup script exited with pandas requires NumPy >= 1.6 due to datetime64 dependency
我运行 Python
$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.2.1'
所以 Numpy 1.6 似乎没有正确安装!
我尝试使用pip(而不是easy_install)安装 Numpy 1.6...
$ sudo pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /Library/Python/2.6/site-packages
Cleaning up...
我添加了--upgrade 标志
$ sudo pip install numpy --upgrade
Requirement already up-to-date: numpy in /Library/Python/2.6/site-packages
Cleaning up...
$ sudo pip install pandas
Downloading/unpacking pandas
Downloading pandas-0.8.1.zip (1.9MB): 1.9MB downloaded
Running setup.py egg_info for package pandas
pandas requires NumPy >= 1.6 due to datetime64 dependency
Complete output from command python setup.py egg_info:
pandas requires NumPy >= 1.6 due to datetime64 dependency
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/pandas
Storing complete log in /Users/MyUsername/Library/Logs/pip.log
我还尝试安装二进制版本的 Numpy http://sourceforge.net/projects/numpy/files/ numpy-1.6.2-py2.6-python.org-macosx10.3.dmg 但它失败了!!! (安装人员说不能在这个磁盘上安装numpy 1.6.2。numpy需要python.org Python 2.6才能安装。
【问题讨论】:
-
你以前安装过 numpy 吗?也许这把事情搞砸了。您应该尝试卸载 numpy,然后重新安装最新版本。
-
我有一个以前的 Numpy 版本 1.2.1,但我不记得这个版本是如何安装的(来自源代码、easy_install、pip、二进制...)。非常奇怪的是我无法安装二进制文件(请参阅我刚刚编辑的帖子的最后一部分)
-
NumPy 1.2.1 安装在哪里 (
import numpy as np; print np)?我建议使用像 EPDFree 或 Anaconda CE 这样的打包发行版,并尽可能避免使用 Apple 的系统 Python -
>>> import numpy as np >>> np.__version__ '1.2.1' >>> print(np) <module 'numpy' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/__init__.pyc'>所以不知道是怎么安装的 -
很好 Wes 建议我使用 EPD...我安装了 Academic 版本(它似乎比 EPD Free 更好)...
$ sudo enpkg numpy安装了我 numpy 但$ sudo enpkg pandas返回@ 987654336@!!!
标签: python numpy pip pandas easy-install