安装python snappy时出错:snappy-c.h:没有这样的文件或目录

2024-09-23 22:21:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用amazon ec2 ubuntu 11.04服务器

 sudo pip install python-snappy 

我还尝试下载了这个包,并输入了“sudo python setup.py install”

我搞错了:

  running build
  running build_ext
  building 'snappy' extension
  gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c snappymodule.cc -o build/temp.linux-x86_64-2.7/snappymodule.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
  snappymodule.cc:31:22: fatal error: snappy-c.h: No such file or directory
  compilation terminated.
  error: command 'gcc' failed with exit status 1

我怎样才能摆脱这个错误?

来源:https://github.com/andrix/python-snappy


Tags: installbuildamazonforsudoerrorec2running
3条回答

可以使用以下命令安装Snappy C库:

基于DEB的:sudo apt-get install libsnappy-dev

基于转速:sudo yum install libsnappy-devel

啤酒:brew install snappy

根据repo

如何在Mac OS X上安装?

有几次报告(第7期和第23期)它不能正确安装在Mac中的库中。 程序应该是

$ brew install snappy # snappy library from Google 
$ CPPFLAGS="-I/usr/local/include -L/usr/local/lib" pip install python-snappy

你需要敏捷的Clibrary

然后必须安装python snappy包装器。

你好像没有安装Snappy-C库

试试吧..已经有人对你的帖子发表了评论

UPDATE: See more highly upvoted post below, which includes instructions to install on DEB-based, RPM-based, and Mac OS (Brew).

相关问题 更多 >