{"id":7091,"library":"cmeel-zlib","title":"cmeel-zlib","description":"`cmeel-zlib` is a specialized Python package that provides a distribution of the `zlib` C library, packaged using `cmeel` (a CMake-based build system for Python wheels). Its primary purpose is to serve as a build dependency for other Python packages that are also built with `cmeel` and require the `zlib` C library. It does not offer a direct Python API. The current version is 1.3.1, with minor releases typically occurring every 2-3 months.","status":"active","version":"1.3.1","language":"en","source_language":"en","source_url":"https://github.com/cmake-wheel/cmeel-zlib.git","tags":["zlib","compression","cmeel","build-system","native-extension"],"install":[{"cmd":"pip install cmeel-zlib","lang":"bash","label":"Install cmeel-zlib"}],"dependencies":[],"imports":[{"note":"`cmeel-zlib` is a CMake-based distribution of the `zlib` C library. It provides the necessary C library for Python packages that are built with `cmeel` and depend on `zlib`. It does not expose any Python APIs itself for direct import or usage.","wrong":"from cmeel_zlib import compress","symbol":"No direct Python symbols exported by `cmeel_zlib`","correct":"This package facilitates the use of the `zlib` C library by other `cmeel`-based Python extensions. For Python-level `zlib` functionality, use the standard library `import zlib`."}],"quickstart":{"code":"import zlib\n\ndata = b\"Hello, cmeel-zlib compression example!\" * 10\ncompressed_data = zlib.compress(data)\ndecompressed_data = zlib.decompress(compressed_data)\n\nprint(f\"Original size: {len(data)} bytes\")\nprint(f\"Compressed size: {len(compressed_data)} bytes\")\nprint(f\"Decompressed data matches original: {data == decompressed_data}\")\n# cmeel-zlib ensures that the underlying zlib C library is available\n# and correctly linked for the standard library's zlib module and other\n# cmeel-based extensions, potentially offering optimized performance.","lang":"python","description":"After installing `cmeel-zlib`, you can use the standard Python `zlib` module. This package ensures that the underlying C `zlib` library is correctly provided and linked for efficient compression and decompression, especially when other `cmeel`-built extensions depend on it. This example demonstrates basic usage of the standard `zlib` module, which benefits from `cmeel-zlib`'s provision of the underlying C library."},"warnings":[{"fix":"To use `zlib` functionality in Python, rely on the standard library `import zlib`. `cmeel-zlib` ensures the underlying C library is available and properly linked for other `cmeel`-based extensions.","message":"`cmeel-zlib` is not a direct Python API library; it does not export any Python symbols for direct import or use. Its primary function is to provide the `zlib` C library as a build dependency for other Python packages built using the `cmeel` build system.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your build environment is clean or explicitly manage `LD_LIBRARY_PATH` (or equivalent environment variables) if you suspect conflicts. For most users, `pip install cmeel-zlib` should integrate smoothly, prioritizing its bundled `zlib`.","message":"When `cmeel-zlib` is installed, it provides its own distribution of the `zlib` C library. This can potentially interact with or override other system-provided `zlib` installations, leading to unexpected behavior or build conflicts if not managed carefully in complex environments.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"`cmeel-zlib` does not provide direct Python imports. Its purpose is to provide the underlying C library for other `cmeel`-built Python extensions. For zlib functionality, use the standard library `import zlib`.","cause":"Attempting to directly import `cmeel_zlib` as a Python module.","error":"ModuleNotFoundError: No module named 'cmeel_zlib'"},{"fix":"Ensure `cmeel-zlib` is installed in the build environment via `pip install cmeel-zlib`. This package is specifically designed to provide `zlib` as a CMake target for other `cmeel` projects.","cause":"Another `cmeel`-based Python project failed to find the `zlib` C library during its build process, indicating the dependency was not met.","error":"CMake Error: The following variables are initialized to the empty string: ZLIB_LIBRARY"},{"fix":"Install `cmeel-zlib` via `pip install cmeel-zlib`. This provides the `zlib` C library in a way that `cmeel` and other build systems can locate it for linking.","cause":"A C extension requiring `zlib` failed to link because the `zlib` library could not be found by the linker during compilation.","error":"cannot find -lz"}]}