无法在 EC2 中安装 适用于 Python34 的 pandas



我正在尝试使用AWS linux发行版在EC2实例中安装panda,以便与Python34一起使用。

我跑了:

sudo pip install pandas

我能够成功地为python 2.7版本安装panda,但当我运行时:

sudo python34 -m pip install pandas

我得到错误:

gcc-phread-Wno未使用的结果-DDYNAMIC_ANNOTATION_ENABLED=1-DNDEBUG-O2-g-管道-Wall-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack protector-param=ssp缓冲区大小=4-m64-mtune=generic-D_GNU_SOURCE-fPIC-fwrapv-fPIC-Ipandas/_libs/src/klib-Ipandas/libs/src-I/usr/local/lib64/python3.4/site-packages/numpy/core/include-I/usr/include/python3.4 m-c pandas/libs/index。o-W没有未使用的功能pandas/libs/index.c:4:20:致命错误:Python.h:没有这样的文件或目录#包括"Python.h"^编译终止。错误:命令"gcc"失败,退出状态为1

后跟:

Command "/usr/bin/python34 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zsa12w6w/pandas/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-svj_8okf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-zsa12w6w/pandas/

如何为python34版本成功安装panda?

  1. 我猜你有一个旧版本的pip,否则它会尝试通过轮子(二进制dist)安装。所以一个选择是升级pip,然后安装panda。(python34 -m pip install -U pip)

  2. 如果您确实想从源代码或任何python c扩展构建panda,则需要安装python开发头,可能类似于yum install python34-python-devel.x86_64

相关内容

最新更新