微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

python – 安装pandas的问题:“命令’llvm-gcc-4.2’失败,退出状态为1”

我想用Python 2.7和“sudo pip install pandas”在MAC OS X 10.7上安装pandas.我得到的一些输出

Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.7-intel-2.7/pandas/index.o
    In file included from pandas/index.c:317:
    pandas/src/numpy_helper.h: In function ‘infer_type’:
    pandas/src/numpy_helper.h:32: error: ‘PyDatetimeArrType_Type’ undeclared (first use in this function)
    pandas/src/numpy_helper.h:32: error: (Each undeclared identifier is reported only once
    pandas/src/numpy_helper.h:32: error: for each function it appears in.)
    pandas/src/numpy_helper.h: In function ‘get_datetime64_value’:
    pandas/src/numpy_helper.h:53: error: ‘PyDatetimeScalarObject’ undeclared (first use in this function)
    pandas/src/numpy_helper.h:53: error: expected expression before ‘)’ token
    pandas/src/numpy_helper.h: In function ‘is_datetime64_object’:
    pandas/src/numpy_helper.h:84: error: ‘PyDatetimeArrType_Type’ undeclared (first use in this function)
    pandas/src/numpy_helper.h: In function ‘is_timedelta64_object’:
    pandas/src/numpy_helper.h:89: error: ‘PytimedeltaArrType_Type’ undeclared (first use in this function) 

我得到了这个:

lipo: can't open input file: /var/tmp//ccaW8SVp.out (No such file or directory)

error: command 'llvm-gcc-4.2' Failed with exit status 1

所有的依赖项(NumPy,pythondateutil,pytz)都运行正常.我还提供了最新版本的Command Line Tools,如下所示:Why am I getting the error: command ‘llvm-gcc-4.2’ failed with exit status 1gcc-4.2 failed with exit status 1

我认为我的问题与这个(没有帮助)的帖子密切相关:Issues with installing pandas in python in MAC

现在我没有选择,真的不知道该怎么做:-(除了寻求帮助…所以提前谢谢!

解决方法:

对我来说,以下修正了它:

sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/
sudo pip install --upgrade numpy
sudo pip install pandas

我注意到Pandas试图链接到框架下的旧版numpy,而不是/Library/Python/2.7/site-packages下的新版本

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐