安装happybase,thriftpy不成功

本文介绍了在安装HappyBase和ThriftPy过程中遇到Python.h文件缺失的错误,并提供了针对Ubuntu、Debian、CentOS等系统的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装happybase的时候会先装thriftpy。安装thriftpy会碰到

thriftpy/transport/cybase.c:13:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/data/yuleke-match/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2imhflbw/thriftpy/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-32m7931x-record/install-record.txt --single-version-externally-managed --compile --install-headers /data/yuleke-match/env/include/site/python3.4/thriftpy" failed with error code 1 in /tmp/pip-build-2imhflbw/thriftpy/

经过查找,在http://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory中找到方法。

For apt (ubuntu, debian...):

sudo apt-get install python-dev  # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

For yum (centos, redhat, fedora...):

sudo yum install python-devel

这样之后就能成功安装了

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值