【问题标题】:python application dependency fastavropython应用程序依赖fastavro
【发布时间】:2020-10-08 10:11:41
【问题描述】:

尝试在 linux rhel 7.8 上安装 pip 包 fastavro==0.23.4 但出现错误:

    creating build/temp.linux-x86_64-3.6/fastavro
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c fastavro/_read.c -o build/temp.linux-x86_64-3.6/fastavro/_read.o
    fastavro/_read.c:4:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-p3u2ii2c/fastavro/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-57h05ysx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-p3u2ii2c/fastavro/

我已经有 python3 开发包:

yum list installed|grep -i devel|grep -i python
python-devel.x86_64             2.7.5-88.el7       @rhui-rhel-7-server-rhui-rpms
rh-python36-python-devel.x86_64 3.6.9-2.el7        @rhui-rhel-server-rhui-rhscl-7-rpms
rh-python38-python-devel.x86_64 3.8.0-15.el7       @rhui-rhel-server-rhui-rhscl-7-rpms

我该如何解决这个问题?

【问题讨论】:

    标签: python python-3.x linux pip rhel7


    【解决方案1】:

    通过在我的 rhel 机器上手动下载包“python3-devel-3.6.8-13.el7.x86_64.rpm”修复了这个问题,使用 yum 安装它并再次运行 pyhton3 pip install。

    【讨论】:

      猜你喜欢
      • 2013-10-08
      • 2013-06-30
      • 2019-02-05
      • 1970-01-01
      • 2010-10-28
      • 2018-05-13
      • 2015-04-26
      • 2018-03-26
      • 2014-02-22
      相关资源
      最近更新 更多