lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

snappy-python wont install

javedwasani opened this issue · comments

docker run --rm -v $(pwd):/foo -w /foo lambci/lambda:build-python3.6 pip install python-snappy --no-deps -t .

Collecting python-snappy
Downloading python-snappy-0.5.4.tar.gz (21 kB)
Building wheels for collected packages: python-snappy
Building wheel for python-snappy (setup.py): started
Building wheel for python-snappy (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /var/lang/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3o1kf3u/python-snappy/setup.py'"'"'; file='"'"'/tmp/pip-install-v3o1kf3u/python-snappy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-anfn2g_h
cwd: /tmp/pip-install-v3o1kf3u/python-snappy/
Complete output (25 lines):
/var/lang/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/init.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/main.py -> build/lib.linux-x86_64-3.6/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/snappy
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.6m -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.6/snappy/snappymodule.o
snappy/snappymodule.cc:31:22: 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: Failed building wheel for python-snappy
Running setup.py clean for python-snappy
Failed to build python-snappy
DEPRECATION: Could not build wheels for python-snappy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at pypa/pip#8368.
Installing collected packages: python-snappy
Running setup.py install for python-snappy: started
Running setup.py install for python-snappy: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /var/lang/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3o1kf3u/python-snappy/setup.py'"'"'; file='"'"'/tmp/pip-install-v3o1kf3u/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-zbo66ijd/install-record.txt --single-version-externally-managed --home /tmp/pip-target-11jkw2jb --compile --install-headers /tmp/pip-target-11jkw2jb/include/python/python-snappy
cwd: /tmp/pip-install-v3o1kf3u/python-snappy/
Complete output (25 lines):
/var/lang/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/init.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/main.py -> build/lib.linux-x86_64-3.6/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/snappy
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.6m -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.6/snappy/snappymodule.o
snappy/snappymodule.cc:31:22: 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: /var/lang/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3o1kf3u/python-snappy/setup.py'"'"'; file='"'"'/tmp/pip-install-v3o1kf3u/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-zbo66ijd/install-record.txt --single-version-externally-managed --home /tmp/pip-target-11jkw2jb --compile --install-headers /tmp/pip-target-11jkw2jb/include/python/python-snappy Check the logs for full command output.

The error says:

fatal error: snappy-c.h: No such file or directory
#include <snappy-c.h>

That's because the instructions say you need to install the snappy library first:

https://github.com/andrix/python-snappy#dependencies