{"id":401,"library":"google-crc32c","title":"Google CRC32C","description":"A Python wrapper of the C library 'Google CRC32C', currently at version 1.8.0. It supports Python versions from 3.9 onwards and is actively maintained with regular updates.","status":"active","version":"1.8.0","language":"python","source_language":"en","source_url":"https://github.com/googleapis/python-crc32c","tags":["checksum","CRC32C","data integrity","Google"],"install":[{"cmd":"pip install google-crc32c","lang":"bash","label":"Install Google CRC32C"}],"dependencies":[],"imports":[{"note":"Ensure to import from 'google_crc32c' namespace.","symbol":"crc32c","correct":"from google_crc32c import crc32c"}],"quickstart":{"code":"import os\nfrom google_crc32c import crc32c\n\n# Example usage\ndata = b'This is a test'\nchecksum = crc32c(data)\nprint('CRC32C Checksum:', checksum)","lang":"python","description":"Calculate the CRC32C checksum of a byte string."},"warnings":[{"fix":"Upgrade Python to 3.9 or higher.","message":"Python versions below 3.9 are not supported.","severity":"breaking","affected_versions":"<3.9"},{"fix":"Ensure your build environment contains necessary C compiler tools (e.g., 'build-base' on Alpine, 'gcc' on Debian/Ubuntu) and Python development headers (e.g., 'python3-dev' or 'python-dev'). Install these dependencies before installing `google-crc32c`. For Alpine, this often means `apk add build-base python3-dev`. If a pure Python fallback is intended, verify its implementation correctly exposes `crc32c`.","message":"The 'crc32c' object cannot be imported from 'google_crc32c', even with the correct import syntax 'from google_crc32c import crc32c'. This typically occurs when the library's C extension fails to build or load, preventing the `crc32c` function from being properly exposed by the module. A pure Python fallback might be used, but could also lead to issues if not correctly initialized.","severity":"breaking","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-12T13:35:38.150Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed using `pip install google-crc32c` and that your Python environment is correctly configured.","cause":"The `google-crc32c` package, though installed with a hyphen, is imported in Python code using an underscore (`google_crc32c`). This error occurs if the package is not installed or if Python cannot find it in the current environment.","error":"ModuleNotFoundError: No module named 'google_crc32c'"},{"fix":"Install the necessary build dependencies for your system, such as `python3-dev` (or `python-dev`), `gcc`, and `build-essential` on Linux (e.g., `sudo apt-get install python3-dev gcc build-essential`). For Windows, ensure you have a compatible C++ build environment, like the one provided by Visual Studio.","cause":"This error typically occurs during installation when pre-compiled wheels for your specific Python version and operating system/architecture are not available, requiring the package to be built from source. It indicates missing C build tools and development headers necessary to compile the underlying C library.","error":"ERROR: Could not build wheels for google-crc32c which use PEP 517 and cannot be installed directly"},{"fix":"Ensure that your system has the required C build tools and Python development headers installed (as described in the 'Could not build wheels' fix) and then try reinstalling `google-crc32c`.","cause":"This is a `RuntimeWarning` indicating that the optimized C extension of the `google-crc32c` library failed to load, leading to a fallback to a slower pure Python implementation. This usually happens due to issues during the package's compilation or if the compiled extension cannot be found/loaded at runtime.","error":"As the c extension couldn't be imported, `google-crc32c` is using a pure python implementation that is significantly slower."},{"fix":"Import the specific functions provided by the library, for example: `from google_crc32c import value` or `from google_crc32c import extend` to calculate CRC32C checksums.","cause":"Users might incorrectly try to import a top-level `crc32c` function directly from the `google_crc32c` module. The `google-crc32c` library exposes its core functionality through `value` and `extend` functions, not a single `crc32c` function directly at the module level.","error":"ImportError: cannot import name 'crc32c' from 'google_crc32c'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}