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

后端 未结 12 1402
感动是毒
感动是毒 2020-12-08 06:36

I am using amazon ec2 ubuntu 11.04 server

 sudo pip install python-snappy 

also I tried to downloaded package and entered \"sudo python set

12条回答
  •  死守一世寂寞
    2020-12-08 07:01

    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
    

提交回复
热议问题