Installing Python 3.12 from source on Oracle Linux 9 running in WSL

I want to install Python 3.12 in Oracle Linux 9 running on Windows Subsystem for Linux. Using the instructions from this link, How to install Python 3.12 from source, I get to the step ./configure —enable-optimizations and it lets me know that stdlib extension modules are n/a for _scproxy, disabled for _sqlite3, and missing for _curses, _curses_panel, _dbm, _gdbm, nis, readline, _tkinter, _uuid, and _bz2.

I’d like to resolve this, but I’m not sure where to start.

Are there packages that I need to install on the Oracle Linux OS using dnf first?
Do I need to grab source directly from the sqlite, tk, etc, projects?
Is there somewhere else I can grab a “complete” Python 3.12 installer from for Oracle Linux 9?
Are there other commands or parameters I can run when I run configure or make that will download these dependencies?

I’m not familiar with Oracle Linux - but it seems clear you first need to install some other dependencies if you want to configure with --enable-optimizations. The blog you referred to is geared towards Ubuntu, so doesn’t tell you everything. The following blog may be more helpful:
How to Install Python 3.10 on Oracle Linux | Atlantic.Net.
Not sure if that will be enough – otherwise, you have to track down each of those dependencies first and may need to install extra libraries.

Is there somewhere else I can grab a “complete” Python 3.12 installer from for Oracle Linux 9?

Have you tried just installing it directly with sudo dnf install python3.12?
See: Installing Python

1 Like

I have tried ‘sudo dnf install python3.12’ and it doesn’t find the package.

Even without the ‘—enable-optimizations’ option, .\configure says these packages are missing.

I think I’m going to try getting 3.12 by adding a Fedora 39 Repo to the Oracle 9 system. Maybe it works, maybe it doesn’t. I’m comfortable assuming the risk of reinstallation on this system if it doesn’t.

Oracle LInux 9 is an Redhat LInux 9 clone/rebuild.
It will be using an older python version based on the time of its release.
This pages explains what verions are available: Chapter 2. Installing and using Python Red Hat Enterprise Linux 9 | Red Hat Customer Portal

In OL 9.2 you can install python 3.11. Is that version good enough for your use?

If you want to know all the packages that you need to install to build python 3.12 you can have a look at the spec file for the Fedora 39 python 3.12.

You can get the source rpm (.src.rpm) from this page: python3.12-3.12.0-1.fc39 | Build Info | koji

You might find that it a good starting point to use the .src.rpm to do your build.
Indeed if you make your python 3.12 for OL9 be an RPM you install it easily.

Do you know how to build RPMs from there .src.rpm files?

I’ve packaged a very simple application with packit to test RPM packaging. I’m sure packaging Python will be more complex. If Packit will work I’ll hack away at it until I get it. Will Packit work for this scenario?

It is far simpler to start with the Fedora 39 source rpm.
Modify its .spec file until it builds for you.

I think you do not know how to install and build source RPMs?

You did not reply to why it must be 3.12 and not 3.11 that is already packed.

It’s got to be 3.12 because that’s what’s going to be deployed.

I told you my experience packaging RPMs. I’ve packaged a simple app as an RPM using Packit.

Thank you for the information and the link to the source, I’ll figure it out from here.