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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenggong2dm/article/details/70172682

错误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





阅读更多 登录后自动展开

更多精彩内容