Python-Snappy的安装 以及报错解决

15 篇文章 0 订阅

错误1:

如果linux环境中,缺少g++,则会报错:


解决办法:

安装g++ (或者下面这个,替代g++的)
yum install gcc-c++


-------------------------------------------------------------------------------------------------------------------------------------------

错误2:

直接使用pip install ,会报错:

    cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
    snappymodule.cc:31:22: error: snappy-c.h: No such file or directory
    snappymodule.cc:77: error: 'snappy_status' was not declared in this scope
    snappymodule.cc:78: error: expected ',' or ';' before '{' token
    snappymodule.cc:45: warning: '_state' defined but not used
    snappymodule.cc:56: warning: 'SnappyCompressError' defined but not used
    snappymodule.cc:57: warning: 'SnappyUncompressError' defined but not used
    snappymodule.cc:58: warning: 'SnappyInvalidCompressedInputError' defined but not used
    snappymodule.cc:59: warning: 'SnappyCompressedLengthError' defined but not used
    snappymodule.cc:77: warning: 'snappy_strerror' defined but not used
    error: command 'gcc' failed with exit status 1


报错根源是找不到关键文件: snappy-c.h


解决办法:

最简便的解决办法是,先装一下 snappy-devel

yum install snappy-devel


然后再装 python-snappy,就没有问题了

pip install python-snappy





  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值