Skip to content

Failed to build in Python 3.12 #20

Closed
@nicolaasuni

Description

@nicolaasuni

Installation in Python 3.12 fails:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
$ uname -a
Linux nuc 6.1.0-15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.66-1 (2023-12-09) x86_64 GNU/Linux
$ python3 --version
Python 3.12.1
$ python3 -m pip install --upgrade zlib-ng
Defaulting to user installation because normal site-packages is not writeable
Collecting zlib-ng
  Using cached zlib-ng-0.2.0.tar.gz (905 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: zlib-ng
  Building wheel for zlib-ng (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for zlib-ng (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-312
      creating build/lib.linux-x86_64-cpython-312/zlib_ng
      copying src/zlib_ng/gzip_ng.py -> build/lib.linux-x86_64-cpython-312/zlib_ng
      copying src/zlib_ng/__init__.py -> build/lib.linux-x86_64-cpython-312/zlib_ng
      copying src/zlib_ng/zlib_ng.pyi -> build/lib.linux-x86_64-cpython-312/zlib_ng
      copying src/zlib_ng/py.typed -> build/lib.linux-x86_64-cpython-312/zlib_ng
      creating build/lib.linux-x86_64-cpython-312/zlib_ng/zlib-ng
      copying src/zlib_ng/zlib-ng/LICENSE.md -> build/lib.linux-x86_64-cpython-312/zlib_ng/zlib-ng
      copying src/zlib_ng/zlib-ng/README.md -> build/lib.linux-x86_64-cpython-312/zlib_ng/zlib-ng
      running build_ext
      Traceback (most recent call last):
        File "/usr/local/bin/cmake", line 5, in <module>
          from cmake import cmake
      ModuleNotFoundError: No module named 'cmake'
      Traceback (most recent call last):
        File "/usr/local/bin/cmake", line 5, in <module>
          from cmake import cmake
      ModuleNotFoundError: No module named 'cmake'
      building 'zlib_ng.zlib_ng' extension
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/src
      creating build/temp.linux-x86_64-cpython-312/src/zlib_ng
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/tmp/tmpx7hk429e -I/usr/local/include/python3.12 -c src/zlib_ng/zlib_ngmodule.c -o build/temp.linux-x86_64-cpython-312/src/zlib_ng/zlib_ngmodule.o
      In file included from src/zlib_ng/zlib_ngmodule.c:8:
      /tmp/tmpx7hk429e/zlib-ng.h:39:10: fatal error: zconf-ng.h: No such file or directory
         39 | #include "zconf-ng.h"
            |          ^~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for zlib-ng
Failed to build zlib-ng
ERROR: Could not build wheels for zlib-ng, which is required to install pyproject.toml-based projects

Note that cmake is actually installed:

$ python3 -m pip install --upgrade cmake
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: cmake in /usr/local/lib/python3.12/site-packages (3.27.9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions