How to Resolve Errors When Installing google-crc32c Version 1.1.3 or Higher on Alpine with Python

Python
2021-11-08 14:52 (3 years ago) ytyng
Building wheels for collected packages: google-crc32c
Building wheel for google-crc32c (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pep517/_in_process.py build_wheel /tmp/tmpa_qqgxr3
cwd: /tmp/pip-install-i8dfak3j/google-crc32c
Complete output (18 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/google_crc32c
copying src/google_crc32c/_checksum.py -> build/lib.linux-x86_64-3.8/google_crc32c
copying src/google_crc32c/__config__.py -> build/lib.linux-x86_64-3.8/google_crc32c
copying src/google_crc32c/__init__.py -> build/lib.linux-x86_64-3.8/google_crc32c
copying src/google_crc32c/cext.py -> build/lib.linux-x86_64-3.8/google_crc32c
copying src/google_crc32c/python.py -> build/lib.linux-x86_64-3.8/google_crc32c
running build_ext
building 'google_crc32c._crc32c' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
creating build/temp.linux-x86_64-3.8/src/google_crc32c
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c src/google_crc32c/_crc32c.c -o build/temp.linux-x86_64-3.8/src/google_crc32c/_crc32c.o
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for google-crc32c

or

#10 1190.0 [pipenv.exceptions.InstallError]: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c src/google_crc32c/_crc32c.c -o build/temp.linux-x86_64-3.8/src/google_crc32c/_crc32c.o
#10 1190.0 [pipenv.exceptions.InstallError]: src/google_crc32c/_crc32c.c:3:10: fatal error: crc32c/crc32c.h: No such file or directory
#10 1190.0 [pipenv.exceptions.InstallError]: 3 | #include
#10 1190.0 [pipenv.exceptions.InstallError]: | ^~~~~~~~~~~~~~~~~
#10 1190.0 [pipenv.exceptions.InstallError]: compilation terminated.
#10 1190.0 [pipenv.exceptions.InstallError]: error: command 'gcc' failed with exit status 1

In such cases, setting the environment variable CRC32C_PURE_PYTHON=1 can be helpful.

Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011