如何修复Python Numpy/Pandas安装? [英] How to fix Python Numpy/Pandas installation?

查看:147
本文介绍了如何修复Python Numpy/Pandas安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Mac OS X 10.6.8上安装Python Pandas库(0.8.1).该库需要Numpy> = 1.6.

I would like to install Python Pandas library (0.8.1) on Mac OS X 10.6.8. This library needs 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

So I tried to install 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似乎没有正确安装!

So Numpy 1.6 doesn't seems to be installed correctly !

我尝试使用pip(而不是easy_install)安装Numpy 1.6 ...

I tried to install Numpy 1.6 with pip (instead of easy_install)...

$ 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/文件/ numpy-1.6.2-py2.6-python.org-macosx10.3.dmg但失败了!!! (安装程序告诉我,无法在此磁盘上安装numpy1.6.2.Numpy需要安装python.org Python 2.6.

I also tried to install binary version of Numpy http://sourceforge.net/projects/numpy/files/ numpy-1.6.2-py2.6-python.org-macosx10.3.dmg but it fails !!! (installer said me that numpy 1.6.2 can't be install on this disk. Numpy requires python.org Python 2.6 to install.

推荐答案

不知道您是否解决了问题,但将来是否有人遇到此问题.

Don't know if you solved the problem but if anyone has this problem in future.

$python
>>import numpy
>>print(numpy)

转到打印的位置,然后删除在那里找到的numpy安装.然后,您可以使用pipeasy_install

Go to the location printed and delete the numpy installation found there. You can then use pip or easy_install

这篇关于如何修复Python Numpy/Pandas安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆