# Configure python 3.12.0, getting error with zlib module

**URL:** <https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055>\
**Category:** Python Help\
**Tags:** help\
**Created:** [April 15, 2024, 3:58pm UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055 "2024-04-15T15:58:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ba345](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ba345/32/19239_2.png) [@ba345](https://discuss.python.org/u/ba345)\
**Post date:** [April 15, 2024, 3:58pm UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/1 "2024-04-15T15:58:43Z")

</div>

Trying to build a Python for the virtual environemnt.  
Trying to build python 3.12.0  
Using this command:

`./configure --enable-optimizations --with-lto=full && make`

have checeked there it zlib module  
the version is 1.2.11

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/3X/4/d/4d5e1ea60a305309269cc1489f2aa082971ab441.png)

> The necessary bits to build these optional modules were not found:  
> \_bz2 \_curses \_curses\_panel  
> \_dbm \_gdbm \_lzma  
> \_tkinter \_uuid readline  
> zlib  
> To find the necessary bits, look in configure.ac and config.log.

How to get the zlib?

---

<div class="post-metadata">

**Author:** ![kknechtel](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kknechtel](https://discuss.python.org/u/kknechtel)\
**Post date:** [April 15, 2024, 4:35pm UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/2 "2024-04-15T16:35:02Z")

</div>

> [@ba345](#):
>
> have checeked there it zlib module

This check **does not** mean that the `zlib` **system** package is available. It only means that someone was able to compile the copy of Python 2.7.16 that’s on your system, using such a package.

> [@ba345](#):
>
> To find the necessary bits, look in configure.ac and config.log.

You should start by following this advice, and then by [reading the section on installation dependencies](https://devguide.python.org/getting-started/setup-building/index.html#install-dependencies) in the guide for Python developers. (Unfortunately, the main user documentation about [building Python on Unix](https://docs.python.org/3/using/unix.html#building-python) does not explain very much about this.)

---

<div class="post-metadata">

**Author:** ![ba345](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ba345/32/19239_2.png) [@ba345](https://discuss.python.org/u/ba345)\
**Post date:** [April 16, 2024, 3:05am UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/3 "2024-04-16T03:05:39Z")

</div>

How do I follow the advice?  
What steps do I do

I open the configure.ac file, is there any line i need to add any command to run?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/3X/9/3/93fe156bf217cf9511f90665c1e1f073b84ab55a.png)

---

<div class="post-metadata">

**Author:** ![jamestwebber](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jamestwebber/32/12799_2.png) [@jamestwebber](https://discuss.python.org/u/jamestwebber)\
**Post date:** [April 16, 2024, 3:14am UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/4 "2024-04-16T03:14:40Z")

</div>

As the linked documentation says: you need to install the dependencies. This is not something that the Python config does for you, it is something you do beforehand. Consider it as similar to installing the compiler, or `make`.

---

<div class="post-metadata">

**Author:** ![Rosuav](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rosuav/32/3429_2.png) [@Rosuav](https://discuss.python.org/u/Rosuav)\
**Post date:** [April 16, 2024, 3:43am UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/5 "2024-04-16T03:43:07Z")

</div>

If you’re on a Debian-family Linux (including Ubuntu), you should be able to `sudo apt build-dep python3` to get the necessary packages for compiling Python from source.

---

<div class="post-metadata">

**Author:** ![ba345](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ba345/32/19239_2.png) [@ba345](https://discuss.python.org/u/ba345)\
**Post date:** [April 17, 2024, 6:22am UTC](https://discuss.python.org/t/configure-python-3-12-0-getting-error-with-zlib-module/51055/6 "2024-04-17T06:22:14Z")

</div>

> [@ba345](#):
>
> ./configure --enable-optimizations --with-lto=full && make

running this command is taking very long, more than 15 minutes, and it is still running ,is this normal?

going for an hour is this normal?
