我使用的是亚马逊ec2 ubuntu11.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
我怎样才能摆脱这个错误呢?
发布于 2018-10-24 17:59:32
我在安装时遇到了一些麻烦。最后下载了https://www.lfd.uci.edu/~gohlke/pythonlibs/提供的预构建内容,一切都很顺利。( Python扩展包的非官方Windows二进制文件)
发布于 2016-07-28 06:19:23
在El Capitan上安装时有很多问题,错误是没有找到snappy-c.h文件。
我必须从tar.gz文件https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz安装snappy
解压并运行
./configure
make
make install
它会将头文件放入/usr/local/include
中
然后需要为cc编译器设置标志来查找头文件:
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"
然后我从egg文件https://pypi.python.org/packages/b1/fe/1d632cdac5dbb5ce84db778af7f733eb469130d8cf4c02f6cd9057a96768/snappy-2.4.1-py2.7-macosx-10.5-intel.egg#md5=b76558c71f1d97feeb8402c345e466bf安装了python-snappy
您可以尝试使用pip install python-snappy
,但它最初找不到头文件,所以我选择了egg文件
要安装鸡蛋,请执行以下操作:
easy_install <eggfile>
python setup.py build
python setup.py install
发布于 2016-09-20 15:21:37
您需要检查以下输出
rpm -q snappy-devel
如果它不存在,请使用以下命令进行安装:
yum install snappy-devel
https://stackoverflow.com/questions/11416024
复制相似问题