Error installing python-snappy: snappy-c.h: No such file or directory

匿名 (未验证) 提交于 2019-12-03 02:06:01

问题:

I am using amazon ec2 ubuntu 11.04 server

 sudo pip install python-snappy  

also I tried to downloaded package and entered "sudo python setup.py install"

I got the error:

  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 

How i could get rid of this error?

source: https://github.com/andrix/python-snappy

回答1:

You need Snappy C library

Then you have to install python-snappy wrapper.

It seems you didn't install Snappy-C library

Try it ..as already a fellow commented for your post



回答2:

You can install Snappy C library with following commands:

DEB-based: sudo apt-get install libsnappy-dev

RPM-based: sudo yum install libsnappy-devel

Brew: brew install snappy



回答3:

According to the repo

How to install it on Mac OS X?

It has been reported a few times (Issue #7 and #23) that it can't be installed correctly the library in Mac. The procedure should be,

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


回答4:

  1. You download snappy lib at here: https://code.google.com/p/snappy/
  2. Extract it
  3. Install by command lines follows: $: ./configure $: make $: make install
  4. Install python-snappy: $: pip install python-snappy


回答5:

had lots of issues installing on El Capitan, with an error saying that the snappy-c.h file was not found.

Had to install snappy from tar.gz file https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz

untar and run

./configure make make install 

it will put the header file in /usr/local/include

then needed to set FLAGS for the cc compiler to find the header file:

export DYLD_LIBRARY_PATH=/usr/local/include export CPPFLAGS="-I/usr/local/include/snappy-c.h" export CFLAGS="-I/usr/local/include/snappy-c.h" export CXXFLAGS="-I/usr/local/include/snappy-c.h" export LDFLAGS="-L/usr/local/lib" 

and then I installed python-snappy from the egg file https://pypi.python.org/packages/b1/fe/1d632cdac5dbb5ce84db778af7f733eb469130d8cf4c02f6cd9057a96768/snappy-2.4.1-py2.7-macosx-10.5-intel.egg#md5=b76558c71f1d97feeb8402c345e466bf

you can try with pip install python-snappy but it originally failed to find the header file, so i went for the egg file

to install the egg:

easy_install  python setup.py build python setup.py install 


回答6:

You need to check the output for

rpm -q snappy-devel 

If it is not present, then install it using this command:

yum install snappy-devel 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!