snappy-c.h: No such file or directory

允我心安 提交于 2021-02-11 17:06:11

问题


I am unable to install python-snappy with pip I have all the required packages, can someone please help me with it.

# /opt/company/project/3.0.0.1/bin/pip3 install --index-url=http://pypi.company.local:9700 --trusted-host pypi.dvms.local python-snappy
 ...SNIP...
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-3.6/snappy._snappy_cffi.c'
    creating build/temp.linux-x86_64-3.6
    building 'snappy._snappy_cffi' extension
    creating build/temp.linux-x86_64-3.6/build
    creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
    gcc -pthread -DNDEBUG -O2 -fPIC -I/opt/company/project/3.0.0.1/include -I/opt/pypy3.6-v7.3.1-linux64/include -c build/temp.linux-x86_64-3.6/snappy._snappy_cffi.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/snappy._snappy_cffi.o
    build/temp.linux-x86_64-3.6/snappy._snappy_cffi.c:543:10: fatal error: snappy-c.h: No such file or directory
     #include "snappy-c.h"
              ^~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/company/project/3.0.0.1/bin/pypy3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4cjkoc8u/python-snappy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4cjkoc8u/python-snappy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-w1vtpk57/install-record.txt --single-version-externally-managed --compile --install-headers /opt/company/project/3.0.0.1/include/site/python3.6/python-snappy Check the logs for full command output.

snappy is already installed

yum install snappy
Last metadata expiration check: 2:36:13 ago on Fri 17 Jul 2020 08:24:25 PM UTC.
Package snappy-1.1.7-5.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

server is running Red Hat Enterprise Linux release 8.2

# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)

EDIT:

I tried @phd's suggestion as well.

# yum install libsnappy-devel
Last metadata expiration check: 1:41:29 ago on Sat 18 Jul 2020 02:37:40 PM UTC.
No match for argument: libsnappy-devel
Error: Unable to find a match: libsnappy-devel

it does not help.

does it mean Redhat does not have libsnappy-devel.


回答1:


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

RPM: sudo yum install libsnappy-devel



来源:https://stackoverflow.com/questions/62962861/snappy-c-h-no-such-file-or-directory

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